Hello there,
I want to split file name in excel using Text to Column vba using dash and underscore as delimeters.
I am using below macro specifying dash or undersocre as OtherChar. How can we have dash and underscore simultaniuosly ?
I want to split this A-B_C into A B C
Thx
I want to split file name in excel using Text to Column vba using dash and underscore as delimeters.
I am using below macro specifying dash or undersocre as OtherChar. How can we have dash and underscore simultaniuosly ?
I want to split this A-B_C into A B C
Thx
VBA Code:
Sub text_to_col()
Application.DisplayAlerts = False
Range("A2", Range("A2").End(xlDown)).TextToColumns _
Destination:=Range("B2"), _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=True, _
Tab:=True, _
Semicolon:=False, _
Comma:=False, _
Space:=True, _
Other:=True, _
OtherChar:="_", _
Application.DisplayAlerts = True
End Sub