1
I have a spreadsheet with 10k lines, in this format (example):
3004977 \{DOWN} \{TAB 9} REMESSAS \%S 18082017 \{TAB} 2 \%D \^ S
3004972 \{DOWN} \{TAB 9} REMESSAS \%S 18082017 \{TAB} 3 \%D
3004972 \{DOWN} \{TAB 9} REMESSAS \%S 18082017 \{TAB} 2 \%D
3004972 \{DOWN} \{TAB 9} REMESSAS \%S 18082017 \{TAB} 2 \%D
3004972 \{DOWN} \{TAB 9} REMESSAS \%S 18082017 \{TAB} 2 \%D
3004972 \{DOWN} \{TAB 9} REMESSAS \%S 18082017 \{TAB} 1 \%D \^ S
3004967 \{DOWN} \{TAB 9} REMESSAS \%S 18082017 \{TAB} 110 \%D \^ S
With each change in column A there is a blank line. But I need to insert 3 more, in all. With the code below, which I found in Soen, he only adds in the first:
Sub AddBlankRows()
'
Dim iRow As Integer, iCol As Integer
Dim oRng As Range
Set oRng = Range("a1")
iRow = oRng.Row
iCol = oRng.Column
Do
'
If Cells(iRow + 1, iCol) <> Cells(iRow, iCol) 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 = ""
'
End Sub
Any suggestions?
From what I understand will always have a line between the data and you need three lines? If this is it I believe that macro below will help you!
– Evert