Hello Excel World,
Can someone help with some VBA lines to automate this "Text to Columns" process;
https://support.office.com/en-gb/ar...-numbers-40105f2a-fe79-4477-a171-c5bad0f0a885
I've tried to edit a recorded step because the column I want to convert is not fixed so my code searches across the table headings until it finds the "Current Cost" text. I think the problem is in the Selection or in the Destination but cannot figure it out. Here's my code;
Range("A1").Select
Do Until ActiveCell = "Current Cost"
If ActiveCell = "" Then Exit Sub
Selection.Offset(0, 1).Select
Loop
'??? Selection.EntireColumn.Select
Selection.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
'???
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
'???
Selection.NumberFormat = "$#,##0"
Thanks in advance,
Bruce
Can someone help with some VBA lines to automate this "Text to Columns" process;
https://support.office.com/en-gb/ar...-numbers-40105f2a-fe79-4477-a171-c5bad0f0a885
I've tried to edit a recorded step because the column I want to convert is not fixed so my code searches across the table headings until it finds the "Current Cost" text. I think the problem is in the Selection or in the Destination but cannot figure it out. Here's my code;
Range("A1").Select
Do Until ActiveCell = "Current Cost"
If ActiveCell = "" Then Exit Sub
Selection.Offset(0, 1).Select
Loop
'??? Selection.EntireColumn.Select
Selection.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
'???
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
'???
Selection.NumberFormat = "$#,##0"
Thanks in advance,
Bruce