+ Reply to Thread
Results 1 to 2 of 2

Activate the newest sheet

  1. #1
    Registered User
    Join Date
    01-12-2011
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Activate the newest sheet

    I am currently trying to access a worksheet but seem to of hit a problem which i am hoping to find some help with.

    I should point out at this time that i am still new to VBA and as such, this may seem like a trivial problem.

    I have two workbooks, Workbook A is the book that the VBA will run from and Workbook B is the book that the required information is pulled from.

    What I have is a workbook that is added to numerous times during the month, and then depending on what work is left, sheets are either moved about or deleted. As a result i may have the following (shortened for ease of explaination)

    Sheet1(Menu)
    Sheet3(TX)
    Sheet34(17Aug11)
    Sheet37(24Aug11)
    Sheet50(02Sept11)

    This is what i see in the VBA Project window.

    My question is, how would i get the VBA code to activate the highest sheet number, irrespective of its tab name, or position within the workbook.

    Any help on this matter would be great

    Thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Activate the newest sheet

    Although I don't condone the actual "activation" process at the end (I would just use the sheetname to grab data directly once i knew the sheetname...) , this does what you asked:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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