How to Remove Line Break in String

前端 未结 13 2161
旧时难觅i
旧时难觅i 2020-12-09 01:16

I want to Remove the Line Break from the string if my string Ends with Line Break.

Sub linebreak(myString)
    If Len(myString) <> 0 Then
        If Rig         


        
13条回答
  •  [愿得一人]
    2020-12-09 01:23

    As you are using Excel you do not need VBA to achieve this, you can simply use the built in "Clean()" function, this removes carriage returns, line feeds etc e.g:

    =Clean(MyString)
    

提交回复
热议问题