+ Reply to Thread
Results 1 to 5 of 5

VBA to open specific spreadsheet and worksheet where names are referenced in a cell

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    4

    VBA to open specific spreadsheet and worksheet where names are referenced in a cell

    Hi

    I am trying to create a vba to open a spreadsheet and go to a specific worksheet within that spreadsheet.
    The name of the spreadsheet is stored in cell A2 and the name of the worksheet is stored in cell B2.

    Please help. Thanks

  2. #2
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: VBA to open specific spreadsheet and worksheet where names are referenced in a cell

    Something like...
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-10-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA to open specific spreadsheet and worksheet where names are referenced in a cell

    Thanks. Just to clarify further :

    Cell A2 : Full path and name of spreadsheet
    Cell B2 : Name of worksheet in file referenced in Cell A2

    I need to have the macro to open file referenced in cell A2 and go to worksheet referenced in cell B2

    So far I have come up with

    Sub OpenFile()
    Dim wrkMyWorkBook As Workbook
    Set wrkMyWorkBook = Workbooks.Open(Filename:=Sheets("Sheet1").Range("A2").Value, Password:="xxx")
    End Sub

    I now need to determine how to go to a specific worksheet in the above spreadsheet. (The workbook is locked).
    Last edited by gato88; 02-11-2014 at 01:40 AM.

  4. #4
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: VBA to open specific spreadsheet and worksheet where names are referenced in a cell

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-10-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA to open specific spreadsheet and worksheet where names are referenced in a cell

    Perfect! Thanks cplettner

    I also added this extra bit to unprotect the worksheet

    .Sheets(MySheet).Unprotect

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How open a worksheet to a specific cell in left corner for positioning purpose?
    By RonRich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2013, 08:30 AM
  2. [SOLVED] Macro to open workbook and go to specific worksheet based on cell reference
    By ajmartin17 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2013, 10:44 AM
  3. Replies: 2
    Last Post: 06-14-2011, 10:56 AM
  4. [SOLVED] Open worksheet at specific cell
    By rob in forum Excel General
    Replies: 5
    Last Post: 08-22-2006, 07:25 PM
  5. Replies: 1
    Last Post: 09-02-2005, 03:05 PM

Tags for this Thread

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