Вот рабочая версия вашего кода. Вы можете посмотреть синтаксис.
Dim WsData As Worksheet
Dim WsReport As Worksheet
Dim Rl As Long ' last row
Dim Rng As Range
Set WsData = Worksheets("Data")
Set WsReport = Worksheets("Report")
With WsData
' look for the last used cell in column B
Rl = .Cells(.Rows.Count, "A").End(xlUp).Row
Set Rng = .Range(.Cells(Rl - 2, 1), .Cells(Rl, 1))
' Pastes the last 3 cells of Column A into the Month column
Rng.Copy Destination:=WsReport.Cells(9, "B")
End With
With WsReport
.Cells(8, "B").Formula = "Month"
.Cells(8, "C").Formula = "Production Cost"
.Cells(8, "D").Formula = "Month"
.Cells(8, "E").Formula = "Inventory Cost"
.Cells(8, "F").Formula = "Total cost"
.Cells(12, "B").Formula = "Total"
' Calculates the Production cost
' there is no calculation unless there are formulas being copied
Rng.Offset(0, 1).Copy Destination:=.Cells(9, "C")
' Calculates the Inventory cost
' there is no calculation
End With
Конечно, все вычисления отсутствуют, поскольку они не включены в ваш вопрос. Я надеюсь, что вы сможете добавить их к предоставленному мной коду.