johnnyhammer
New Member
- Joined
- Nov 8, 2015
- Messages
- 7
I need to insert a blank row if the left, 3 does not match. the code below, does not separate correctly.
Code:
Code:
Application.ScreenUpdating = False
Dim iRow As Integer, iCol As Integer
Dim oRng As Range
Set oRng = Worksheets("doc1").Range("A2")
iRow = oRng.Row
iCol = oRng.Column
Do
'
If Cells(Left(iRow + 1, iCol), 3) <> Cells(Left(iRow, iCol), 3) Then
Cells(iRow + 1, iCol).EntireRow.Insert shift:=xlDown
iRow = iRow + 2
Else
iRow = iRow + 1
End If
'
Loop While Not Cells(iRow, iCol).Text = ""
Application.ScreenUpdating = True
End Sub