+ Reply to Thread
Results 1 to 3 of 3

reference a sheet with variable?

  1. #1
    Registered User
    Join Date
    05-15-2007
    Posts
    4

    reference a sheet with variable?

    Hi there,

    I was wondering if there was any way to reference a sheet with a variable name instead of needing to know the exact name of the sheet?

    I am trying to open an individual sheet into my workbook with the code:

    Please Login or Register  to view this content.
    That works fine, if the sheet the person is trying to open is called "EVENTS". However I would like to implement something like

    Sheets(sFileName)

    to open the name of the sheet the same as the file name.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I'm not sure what you are trying to do. Does it help to know that the last three lines do the same thing?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-04-2006
    Posts
    24

    in case its not sheet 1

    if your sheet is labeled the same name as your workbook then this will work..

    Please Login or Register  to view this content.

+ Reply to Thread

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