C
Chris Premo
I'm parsing through a Text file with excel and trying to minimize the
code. This is the code I've started with and would like to use a Do
While loop. I've defined my starting and ending points with the ActRow
and ActColumn statements. Unfortunately, the "ActiveCell.Column"
statement returns a numeric value (1 in this case) for Column "A".
How can I convert this to "A", then "B", then "C", etc until I reach
the "ActRow" value (in my case 30)?
Columns("A:B").Select
Columns("A:B").EntireColumn.AutoFit
Range("A1").Select
Selection.End(xlDown).Select
ActRow = ActiveCell.Row
Dim ActColumn
ActColumn = ActiveCell.Column
ActColumn2 = ActColumn + 2
Range(ActColumn & "1:" & ActColumn & ActRow).Select
Selection.Cut
Range(ActColumn2 & "1").Select
ActiveSheet.Paste
Do While Counter <= ActRow
Range(ActColumn2 & "2:" & ActColumn & ActRow).Select
Selection.Cut
Range(ActColumn3 & "1").Select
ActiveSheet.Paste
ActColumn2 = ActColumn2 + 1
ActColumn3 = ActColumn3 + 1
Counter = Counter + 1
Loop
--
code. This is the code I've started with and would like to use a Do
While loop. I've defined my starting and ending points with the ActRow
and ActColumn statements. Unfortunately, the "ActiveCell.Column"
statement returns a numeric value (1 in this case) for Column "A".
How can I convert this to "A", then "B", then "C", etc until I reach
the "ActRow" value (in my case 30)?
Columns("A:B").Select
Columns("A:B").EntireColumn.AutoFit
Range("A1").Select
Selection.End(xlDown).Select
ActRow = ActiveCell.Row
Dim ActColumn
ActColumn = ActiveCell.Column
ActColumn2 = ActColumn + 2
Range(ActColumn & "1:" & ActColumn & ActRow).Select
Selection.Cut
Range(ActColumn2 & "1").Select
ActiveSheet.Paste
Do While Counter <= ActRow
Range(ActColumn2 & "2:" & ActColumn & ActRow).Select
Selection.Cut
Range(ActColumn3 & "1").Select
ActiveSheet.Paste
ActColumn2 = ActColumn2 + 1
ActColumn3 = ActColumn3 + 1
Counter = Counter + 1
Loop
--