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.
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