Results 1 to 3 of 3

Activate another open workbook and sheet

Threaded View

DFrank231 Activate another open... 01-15-2013, 09:30 AM
patel45 Re: Activate another open... 01-15-2013, 10:52 AM
DFrank231 Re: Activate another open... 01-15-2013, 11:14 AM
  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    43

    Activate another open workbook and sheet

    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)

      Dim Entry As String
        Dim Filepath As String
    
    
        Filepath = Range("D6").Value
        Entry = Range("D8").Value
    
    
        Workbooks(Filepath).Activate
         Worksheets(Entry).Activate
    Do i need to be using the Workbook object or will this work with strings?
    Last edited by DFrank231; 01-15-2013 at 09:34 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1