I've cobbled together the following code:
Sub Paste_Formulas()
'
' Paste_Formulas Macro
Dim totalrow As Long
Dim lc As Range
With ActiveSheet
Set lc = [P:P].Find(What:="Total", After:=[P19], LookIn:=xlFormulas, LookAt:=xlWhole, SearchDirection:=xlPrevious)
If Not lc Is Nothing Then totalrow = lc.Row
Range("N16:IL16").AutoFill Destination:=Range("N19:N" & totalrow), Type:=xlFillDefault
End With
'
End Sub
The totalrow will vary based on how many rows get inserted. In column P there is a "Total". I want the macro to copy the formulas from N16:IL16 and paste them into every row that has data, starting on row 19 down to just above the Total row. I know my current formula shows the totalrow as the final row, but one problem at a time... What's highlighted in yellow is what excel is showing as the issue. I'm stumped on what's causing it.
Sub Paste_Formulas()
'
' Paste_Formulas Macro
Dim totalrow As Long
Dim lc As Range
With ActiveSheet
Set lc = [P:P].Find(What:="Total", After:=[P19], LookIn:=xlFormulas, LookAt:=xlWhole, SearchDirection:=xlPrevious)
If Not lc Is Nothing Then totalrow = lc.Row
Range("N16:IL16").AutoFill Destination:=Range("N19:N" & totalrow), Type:=xlFillDefault
End With
'
End Sub
The totalrow will vary based on how many rows get inserted. In column P there is a "Total". I want the macro to copy the formulas from N16:IL16 and paste them into every row that has data, starting on row 19 down to just above the Total row. I know my current formula shows the totalrow as the final row, but one problem at a time... What's highlighted in yellow is what excel is showing as the issue. I'm stumped on what's causing it.