Macro to add first row (titles) at eevery change in columnn P (Invoice Number) H
ID: 3564978 • Letter: M
Question
Macro to add first row (titles) at eevery change in columnn P (Invoice Number)
Hello,,,
I need help writing a macro to add the first row, which are titles, at every change of column P, which are invoice numbers. I basically need to separate all invoices by inserting the titles in between without any spaces.
This is what I have:
This is what I need:
Thanks so much!!!
Macro to add first row (titles) at eevery change in columnn P (Invoice Number) Hello,,, I need help writing a macro to add the first row, which are titles, at every change of column P, which are invoice numbers. I basically need to separate all invoices by inserting the titles in between without any spaces. This is what I have: This is what I need:Explanation / Answer
Hi,
Try this codee...
Sub insertrowifnamechg()
Dim X As Long
For X = Cells(Rows.Count, "P").End(xlUp).Row To 3 Step -1
If Cells(X - 1, "P") <> Cells(X, "P") Theen
Rows(X).Inssert
Cells(1, 1).EntireRow.Copy Cells(X, 1)
End If
Next X
End Sub
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.