Forum Discussion
Need help with VBA - error 424 object required
I think the VBA command is actually Workbooks.Open not Workbook.open
Try using this syntax instead. You will also need to specify a file extension. So maybe this:
Workbooks.Open Filename:="\\thebridgeeastmidlands-my.sharepoint.com@SSL\personal\data_thebridge-eastmidlands_org_uk\Business Services\CST\16. Communications\14. Reporting\Quaterly Reports\MASTER REPORT.xlsx
- Georgina Sothcott-GilsonMay 25, 2018Copper Contributor
Thank you so much for replying, it worked!
But.... now it is saying 'Run-time error '9': Subscript out of range'
Are you able to help with this one too?
Thank you so much in advance.
- Georgina Sothcott-GilsonMay 25, 2018Copper Contributor
This line is the issue:
Worksheets("DATA Referal numbers").Select
Full:
Sub AccumlatedDataforQuaterlyReports()
Dim LastRow As Integer, i As Integer, erow As Integer
LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).RowFor i = 2 To LastRow
Range(Cells(i, 1), Cells(i, 13)).Select
Selection.Copy
Workbooks.Open Filename:="\\thebridgeeastmidlands-my.sharepoint.com@SSL\personal\data_thebridge-eastmidlands_org_uk\Business Services\CST\16. Communications\14. Reporting\Quaterly Reports\MASTER REPORT.xlsx"
Worksheets("DATA Referal numbers").Select
erow = AactiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ActiveSheet.Cells(erow, 1).Select
ActiveSheet.Paste
ActiveWorkbook.Save
ActiveWorkbook.Close
Next i
End Sub- Matt MickleMay 31, 2018Bronze Contributor
Hey Georgina-
I just wanted to follow up and see if you were able to get this code working the way you expected? Please feel free to post back to the community if you need additional help or clarification.