K
KG Old Wolf
I have a large table with infrequent blank cells in a single column. I want
to located these and insert a new row directly after that blank cell's row.
This isn't working ....
Sub InsertBlankLine()
'
FinalRow = Cells(Rows.Count, 8).End(xlUp).Row
'
For Counter = 1 To FinalRow
Set curCell = Worksheets("Sheet1").Cells(Counter, 6)
If curCell.Value < 1 Then curCell.Value = FinalRow
'
ActiveCell.Offset(1).EntireRow.Insert Shift:=xlDown
'
Next Counter
End Sub
Row 8 contains the first blank cell condition but the macro inserts 13 blank
rows right after the first row. (13 is the value of FinalRow).
I have spent 4 hours on this trying every combination I can think of. Your
help is appreciated.
to located these and insert a new row directly after that blank cell's row.
This isn't working ....
Sub InsertBlankLine()
'
FinalRow = Cells(Rows.Count, 8).End(xlUp).Row
'
For Counter = 1 To FinalRow
Set curCell = Worksheets("Sheet1").Cells(Counter, 6)
If curCell.Value < 1 Then curCell.Value = FinalRow
'
ActiveCell.Offset(1).EntireRow.Insert Shift:=xlDown
'
Next Counter
End Sub
Row 8 contains the first blank cell condition but the macro inserts 13 blank
rows right after the first row. (13 is the value of FinalRow).
I have spent 4 hours on this trying every combination I can think of. Your
help is appreciated.