Bass71
MIS
- Jun 21, 2001
- 79
I am trying to write a Do-Loop statement in an Excel macro that starts in column A, populates cells along row 1 that meet the conditions and ends at AA. But it does not popluate any of the cells in row 1 - it immediately goes to AA1.
The code is as follows:
Range("A1"
.Select
Do Until Range("AA1"
.Select
If ActiveCell.Value = "" Then
ActiveCell.Value = ""","""
ActiveCell.Offset(0, 1).Select
Else
ActiveCell.EntireColumn.Select
Selection.Insert Shift:=xlToRight
ActiveCell.Value = ""","""
ActiveCell.Offset(0, 2).Select
End If
Loop
Thanks so much and Happy New Year!!
The code is as follows:
Range("A1"
Do Until Range("AA1"
If ActiveCell.Value = "" Then
ActiveCell.Value = ""","""
ActiveCell.Offset(0, 1).Select
Else
ActiveCell.EntireColumn.Select
Selection.Insert Shift:=xlToRight
ActiveCell.Value = ""","""
ActiveCell.Offset(0, 2).Select
End If
Loop
Thanks so much and Happy New Year!!