Paste formula to multiple sheets

Wsaip49

New Member
Joined
Nov 2, 2020
Messages
1
Office Version
  1. 2016
Platform
  1. MacOS
I am trying to copy and paste to last row this formula for each sheet, same format,
Jan_21-Dec_21. I have no idea how to start.

VBA Code:
Sub PostToOct_21()
Dim WS1 As Worksheet
Dim WS13 As Worksheet
Set WS1 = Worksheets("Invoice")
Set WS13 = Worksheets("Oct_21"
' figre out which row is the next row
NextRow = WS13.Cells(Rows.Count, 1).End(xlUp).Row + 1
' Write the Important values to Oct_21


WS13.Cells(NextRow, 1).Resize(1, 4).Value = Array(WS1.Range("E3"), WS1.Range("Y2"), WS1.Range("E4"), Range("InvTot"))

Range("J9").Select

Selection.Copy

Range("J10").PasteSpecial xlPasteFormulas
Dim rngCopy As Range, rngPaste As Range

With ActiveSheet
Set rngCopy = .Range(.Range("A9:K9"), .Cells(1, Columns.Count).End(xlToLeft))

Set rngPaste = .Range(.Range("A10:K10"), .Cells(Rows.Count, 1).End(xlUp)).Resize(, rngCopy.Columns.Count)

Cells(9, 10).Copy

Cells(10, 10).PasteSpecial (xlPasteFormats)

Application.CutCopyMode = False

End With

End Sub
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,214,999
Messages
6,122,645
Members
449,093
Latest member
Ahmad123098

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top