Hello All.
The code below is sort of what im after, although instead of inserting a row when it finds a match i want it to insert a row if it contains the word "Total".
Thankyou for all your help in advance
The code below is sort of what im after, although instead of inserting a row when it finds a match i want it to insert a row if it contains the word "Total".
Code:
Dim cell As RangeFor Each cell In Range("B2", Cells(Rows.Count, "B").End(xlUp).Address)
'loop from B1 to the last used cell in column B
If cell.Offset(-1, 0).Value2 <> cell.Value2 And cell.Offset(-1, 0) <> vbNullString Then cell.EntireRow.Insert
'if the cell above is different and not null then it adds a row above
Next cell
Thankyou for all your help in advance