Good day all,
I have a code that saves a selected set of pages from a workbook, i know the code works but for some reason it comes up with an error code of "Runtime-error "9": Subscript out of range? Anybody have any ideas to bypass the page code or to solve the error, thanks heaps guys & have a great day - Marco
Private Sub CommandButton2_Click()
Sheets(Array("PAGE 1", "PAGE 2", "PAGE 3", "Page4+", "Rescue Plan", "Final Page")). _
Copy
Dim FPATH As String
FPATH = "C:\Users\username\Desktop\SWMSRecords\"
ActiveWorkbook.SaveAs FPATH & Sheets("PAGE 1").Range("T1").Value & ".xlsx"
ActiveWorkbook.Close
Windows("SWMS Final1.xlsm").Activate
Sheets("Start").Select
End Sub
Bookmarks