Sub Macro5() ' ' Macro5 Macro '
'
Dim wbk As Workbook
Application.ScreenUpdating = False
Set wbk = Workbooks.Open("g:\Work\EU Personal Assignment.xlsx")
Range("O2:R2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Dashboard_for_Roshan.xlsm").Activate
Range("A65536").End(xlUp).Select
ActiveSheet.Paste
Windows("EU Personal Assignment.xlsx").Activate
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Dashboard_for_Roshan.xlsm").Activate
Range("E65536").End(xlUp).Select
ActiveSheet.Paste
Windows("EU Personal Assignment.xlsx").Activate
Range("AC2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Dashboard_for_Roshan.xlsm").Activate
Range("F65536").End(xlUp).Select
ActiveSheet.Paste
Call .wbk.Close(False) <- i get the error here
End Sub
Prior to the excel End(xlUp) i was using
Cells(Cells(Rows.Count, "A").End(xlUp).Row + 1, "A").Select
but i was unable to paste data using this.
Edit: the error was an extra . before .wbk but now it replaces the previous row data, whereas i want it to paste data below the last used row any advice?
Cheers Mathew
Range("A" & Range("A" & Rows.count).End(xlup).ROw+1).Value = "last cell + 1"
- user2140173