Example with Expected Outcome.xlsxExample with Expected Outcome.xlsxI'm trying to piece a bit of code together from different solutions I've come across. What I have runs but doesn't insert rows. What did I do wrong?
Sub InsertAfterDup()
Dim i As Long
For i = ActiveSheet.UsedRange.Columns.Count + 1 To 2 Step -1
If Cells(2, i).Previous = "*dup*" Then Cells(2, i).EntireColumn.Insert
Next i
End Sub
Once I get this worked out, I'm trying to piece the code together that will find the max in Col. B from the two rows above the new row, and place the value in the new row, Col. B. Additionally, I want it to concatenate the original text containing the "dup" with "_max" in Col. A of the new row. I can do this manually, but there are ~50 of these "dup" rows.
Bookmarks