lundi 29 mars 2021

Insert row and copy formula only from cell below

This should be easy but I haven't done this in so long I'm struggling with the elements.

I need to insert a new row in A21. I need the formulas ONLY to be copied up into the new row. The below is copying values also. Its making me crazy. I'll need it to repeat three times.

Sub NewData()

' NewData Macro
' Inserts rows and copies formulas up.

' Keyboard Shortcut: Ctrl+d



Range("A21").EntireRow.Insert

Range("A22").EntireRow.Copy
Range("A21").PasteSpecial xlPasteFormulas
Application.CutCopyMode = False

End Sub

I considered a loop but that was a struggle also. The data only goes to column T.

Aucun commentaire:

Enregistrer un commentaire