“VBA Hapus Jeda Garis” Kode Jawaban

VBA Hapus Jeda Garis

' Removes line breaks and spaces at the end of text
Function RemoveLastLineBreaks(ByRef pText As String) As String
    Dim textLng As Long
    RemoveLastLineBreaks = pText
    textLng = Len(RemoveLastLineBreaks)
    While (textLng > 0 And (Mid(RemoveLastLineBreaks, textLng) = vbCr _
            Or Mid(RemoveLastLineBreaks, textLng) = vbLf) _
            Or Mid(RemoveLastLineBreaks, textLng) = " ")
        RemoveLastLineBreaks = Mid(RemoveLastLineBreaks, 1, textLng - 1)
        textLng = Len(RemoveLastLineBreaks)
    Wend
End Function
VasteMonde

vba hapus vbcrlf terakhir

' Removes the Line Break from the string if my string Ends with Line Break
Sub RemoveLineBreak(myString)
    If Len(myString) > 0 Then
        If Right$(myString, 2) = vbCrLf Or Right$(myString, 2) = vbNewLine Then 
            myString = Left$(myString, Len(myString) - 2)
        End If
    End If
End Sub
VasteMonde

Jawaban yang mirip dengan “VBA Hapus Jeda Garis”

Pertanyaan yang mirip dengan “VBA Hapus Jeda Garis”

Lebih banyak jawaban terkait untuk “VBA Hapus Jeda Garis” di VBA

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya