+ Reply to Thread
Results 1 to 5 of 5

Refer to a worksheet

  1. #1
    Registered User
    Join Date
    02-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Refer to a worksheet

    Hi,

    Basically, i have a macro which unhides a worksheet and selects that worksheet

    Please Login or Register  to view this content.
    The beginning of that worksheet will always start with "new" but there is a need to add additional numbers to the worksheet name which breaks the code. How can I refer to that worksheet just using the beginning 3 letters?

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Refer to a worksheet

    maybe like this
    Sheets("New*").Select
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    02-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Refer to a worksheet

    I've tried that but it doesn't work sadly. Any other idea? I'm probably missing something really obvious.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Refer to a worksheet

    Well, I hate to have to loop through the worksheets, but I don't seen any alternative.

    The downside to this code is if there are multiple sheets with "new" in the name they will also be made visible.

    There is probably another way but, seeing as you indicate the name will be modified with numbers appended, this will unhide the sheet.

    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Registered User
    Join Date
    02-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Refer to a worksheet

    Thanks - this does the job.

+ 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