Hello
To my ability it's a bit complicated.
However my problem is that I have several hundred sheets which have to do the same procedure.
I have to search a row with ID's, whenever that number changes, I have to put in a cell above and below when the numbers changes.
SO for example I have in row C:
111
111
222
222
333
that have to be:
111
111
(new row)
222
222
(new row)
333
Then I have to type in a certain text below and above when the value changes.
I have this code to search and insert a cell:
Sub InsertRows()
Dim lastRow As Long
Dim rowPtr As Long
lastRow = Range("C" & Rows.Count).End(xlUp).Row
For rowPtr = lastRow To 2 Step -1
If Not IsEmpty(Range("C" & rowPtr)) Then
If Range("C" & rowPtr) <> Range("C" & rowPtr - 1) Then
Range("C" & rowPtr).EntireRow.Insert
End If
End If
Next
End Sub
However I have to seach column B
for matching values.
so column b will have the same values somewhere I.e:
111
111
222
222
333
I have to find that matching value and copy the text from the corresonding row (in column B) to the inserted in the rows the macro made when the values in column C changes.
Hope I have made my issue understandable, please tell me if it helps to make some sort of draft to upload or something.
Appreciate any help or guidance.
Thanks in advance
Kind regards
Bookmarks