Hello all,
Would someone tell me why the code below is not working? I am trying to insert a row in between 16034 & 16031.
Objective: every time there is a number change (in column A) I would like to insert a row. The numerical data is tens of thousands of lines long.
Thanks for your time. I appreciate it!
Data Set
16034
16034
16034
16034
16031
16031
16031
x = 2
Do
ActiveSheet.Cells(x, 1).Select
If ActiveSheet.Cells(x, 1) <> Selection.Offset(-1, 0) Then
Selection.EntireRow.Insert
Else
End If
x = x + 2
Loop Until Trim(ActiveSheet.Cells(x, 1)) = ""
Would someone tell me why the code below is not working? I am trying to insert a row in between 16034 & 16031.
Objective: every time there is a number change (in column A) I would like to insert a row. The numerical data is tens of thousands of lines long.
Thanks for your time. I appreciate it!
Data Set
16034
16034
16034
16034
16031
16031
16031
x = 2
Do
ActiveSheet.Cells(x, 1).Select
If ActiveSheet.Cells(x, 1) <> Selection.Offset(-1, 0) Then
Selection.EntireRow.Insert
Else
End If
x = x + 2
Loop Until Trim(ActiveSheet.Cells(x, 1)) = ""