somesoldiers
Board Regular
- Joined
- Feb 23, 2008
- Messages
- 199
Hi Guys
Can you advise how I can amend the below code so it will not add any rows where a cell in column F is blank please?
Can you advise how I can amend the below code so it will not add any rows where a cell in column F is blank please?
Code:
Sub InsRow()
Dim LastRow As Long
Dim i As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "F").End(xlUp).Row
For i = LastRow To 2 Step -1
If .Cells(i, "F").Value <> .Cells(i - 1, "F").Value Then
.Rows(i).Insert
End If
Next
End With
End Sub