Hallo. This is a simple copy paste task but VBA makes me crazy with errors. Where is my mistake? The task is to copy a range of cells from WBb to WBa. Both of WBs are open.
Code:
Sub GasRate()Dim WBa As Workbook
Dim WBb As Workbook
Dim lastRow As Integer
Set WBa = Workbooks("GL Rates Calculation.xlsm")
Set WBb = Workbooks("DPR_ALS_June_2018.xlsm")
WBb.Sheets("Gas Balance").Cells(Rows.Count, "AC").End(xlUp).Row.Resize(-15).Copy <===Error "424", object required here.
WBa.Sheets("GL").Range("N5").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub