Sub row_inserter()
I got the code below from a colleague to insert a row.
I'm trying to understand how it all fits together and was wondering if someone could explain how/ what the Offset command does, as it seems to be something pretty common.
Thanks in advance.
Matt
Range("A1").Select
Do Until ActiveCell = ""
If ActiveCell.Offset(1, 0) <> "" Then
ActiveCell.Offset(1, 0).EntireRow.Insert
ElseIf ActiveCell.Offset(1, 0) = "" Then
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
I got the code below from a colleague to insert a row.
I'm trying to understand how it all fits together and was wondering if someone could explain how/ what the Offset command does, as it seems to be something pretty common.
Thanks in advance.
Matt
Range("A1").Select
Do Until ActiveCell = ""
If ActiveCell.Offset(1, 0) <> "" Then
ActiveCell.Offset(1, 0).EntireRow.Insert
ElseIf ActiveCell.Offset(1, 0) = "" Then
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub