Hi,
See attached.
My preferred method for this sort of stuff is to hold any master formula on the sheet and copy them as appropriate. Here I've used a new hidden row 1.
And specifically identifying the last column with a range name is to be preferred since the used range property is not particularly safe. For instance entering a value past the end column of the invoice and then deleting it changes the used range until you subsequently save the workbook.
So the attached uses range names and the following macro
Bookmarks