vba remove last vbcrlf

The solution for “vba remove last vbcrlf” can be found here. The following code will assist you in solving the problem.

‘ 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

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts