excel insert blank row for value change in column

The solution for “excel insert blank row for value change in column” can be found here. The following code will assist you in solving the problem.

Sub InsertRowsAtValueChangeColumnB()
Dim X As Long, LastRow As Long
Const DataCol As String = “B”
Const StartRow = 2
LastRow = Cells(Rows.Count, DataCol).End(xlUp).Row
Application.ScreenUpdating = False
For X = LastRow To StartRow + 1 Step -1
If Cells(X, DataCol).Value <> Cells(X – 1, DataCol) Then Rows(X).Insert
Application.ScreenUpdating = True
End Sub


Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts