Can anyone help with dynamic range selection while performing text to columns? I have the following macro generated to acheive the same:
Sub Remove_Delimiter()
Range("A4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("A4"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="_", FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2)), _
TrailingMinusNumbers:=True
Cells.Select
Cells.EntireColumn.AutoFit
End Sub
To illustrate further, for example if have a column with delimited values (in which ever column in the worksheet):
Column A
a_b_c
a_c_d
b_c_d
c_d_e
Output:
Column A Column B Column C
a b c
a c d
b c d
c d e
I need to be able to select the Range wherever i need in the worksheet and convert text to columns. Possibly a inputbox where i can provide my Range selection. I dont want to hardcode my Range selection like we did in the above macro:
Selection.TextToColumns Destination:=Range("A4")
Thanks in advance!
Bookmarks