I have a main spreadsheet that opens another spreadsheet and copies that second workbooks directory to a cell on the main page. I am trying to be on the main workbook and activate a certain sheet on the second workbook, which is determined by a data validation list of the sheet names. I want to have the sheet be selected, and the user clicks a button and it will activate the directory in D6 and the sheet in D8 of this picture.
I saw somewhere that said something like the code below would work, but i get an error on the Workbook activation line. (error: Run-time error '9': Subscript out of range)
Do i need to be using the Workbook object or will this work with strings?![]()
Dim Entry As String Dim Filepath As String Filepath = Range("D6").Value Entry = Range("D8").Value Workbooks(Filepath).Activate Worksheets(Entry).Activate
Bookmarks