Hi there,
I have the following code that is supposed to insert a blank row at every change change in column 5, but for some reason it is not working. Its a relatively simple code so I dont know what the problem can be. It seems to be working properly on some worksheets but not others, but not sure why
I have the following code that is supposed to insert a blank row at every change change in column 5, but for some reason it is not working. Its a relatively simple code so I dont know what the problem can be. It seems to be working properly on some worksheets but not others, but not sure why
Code:
Sub insertblankrow()
Dim change As Range
Set change = ActiveSheet.UsedRange
For i = change.Rows.Count To 3 Step -1
If Cells(i, 5).Value <> Cells(i - 1, 5).Value Then
ActiveSheet.Rows(i).Insert Shift:=xlDown
End If
Next
End Sub