I have a column with numbers like:
66234
666575
66567
665687
66090
66000
And I need to write code that detects when "77" + SomeNumber starts. And insert empty row between new numbers.
What command I should use?
I have a column with numbers like:
66234
666575
66567
665687
66090
66000
And I need to write code that detects when "77" + SomeNumber starts. And insert empty row between new numbers.
What command I should use?
Try the below:
Sub InsertRow()
Dim i As Long
Dim n As Long
n = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To n
If Left(Cells(i, 1), 2) = 77 Then
Cells(i + 1, 1).EntireRow.Insert
End If
Next i
End Sub
replace the 1 in n=...
with the column that has the main numbers in
replace the cells(i,1)
and for i =1
with the respective rows to begin at :)