Hi,
I'm trying to insert a row above any cell with a value in column A but it keeps count blanks as values.
this is what I've been trying to use:
Sub Test()
Application.ScreenUpdating = False
'Modified 12-4-17 6:45 AM EST
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
For i = Lastrow To 1 Step -1
If Cells(i, "C").Value Then If i > 1 Then Rows(i).Resize(1).Insert xlUp
Next
Application.ScreenUpdating = True
End Sub
but no success.
what am I doing wrong?
I'm trying to insert a row above any cell with a value in column A but it keeps count blanks as values.
this is what I've been trying to use:
Sub Test()
Application.ScreenUpdating = False
'Modified 12-4-17 6:45 AM EST
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
For i = Lastrow To 1 Step -1
If Cells(i, "C").Value Then If i > 1 Then Rows(i).Resize(1).Insert xlUp
Next
Application.ScreenUpdating = True
End Sub
but no success.
what am I doing wrong?