+ Reply to Thread
Results 1 to 6 of 6

goto type function

  1. #1
    Registered User
    Join Date
    10-03-2007
    Posts
    20

    goto type function

    Hiya,

    I was hoping someone could tell me how I might do the following:

    1. On opening the rollbook, a person will be directed to a certain worksheet, ie. like an introduction sheet.

    2. I want to have buttons that take a person to a specific worksheet.

    Alternatively,

    Is there a code out there that reads the date from the computer and automatically sends you to your worksheet that corresponds with the month. ie. worksheet called february, you open your file and because its feb it takes you streight there?

    Thanks in advance.

    To all that have helped me with previous questions and repeat help, I want to say a big thanks, I've created a tool that has lessened the workload on a lot of people, which ultimately means more "coffee breaks" :P

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by RobMarshall
    Hiya,

    I was hoping someone could tell me how I might do the following:

    1. On opening the rollbook, a person will be directed to a certain worksheet, ie. like an introduction sheet.

    2. I want to have buttons that take a person to a specific worksheet.

    Alternatively,

    Is there a code out there that reads the date from the computer and automatically sends you to your worksheet that corresponds with the month. ie. worksheet called february, you open your file and because its feb it takes you streight there?

    Thanks in advance.

    To all that have helped me with previous questions and repeat help, I want to say a big thanks, I've created a tool that has lessened the workload on a lot of people, which ultimately means more "coffee breaks" :P
    Yes, just put the following code in the Workbook_Open event:

    Please Login or Register  to view this content.
    Rgds

  3. #3
    Registered User
    Join Date
    10-03-2007
    Posts
    20
    Hi Richard,

    I have the following words in Column P2 "January 2009". Is this enough to trigger this code.

    I tried this:

    Please Login or Register  to view this content.
    with no success, how do I change my rollbook or my code to achieve a working state?

    Cheers,

    Rob

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by RobMarshall
    Hi Richard,

    I have the following words in Column P2 "January 2009". Is this enough to trigger this code.

    I tried this:

    Please Login or Register  to view this content.
    with no success, how do I change my rollbook or my code to achieve a working state?

    Cheers,

    Rob
    Hello Rob,

    The code is triggered as the workbook opens. It assumes of course that you have a sheet called 'February' as per your original requirement - and assuming you're system date is correctly set and you are running it this month. You'll need sheets named 'March', 'April' etc if running in those months.

    The contents of P2 are irrelevant. I only put in A1 as a default position for the cursor to end up.

    Neither did I put in any error checking in the event that you don't have a sheet named the same as the month. You could put an extra line in just before the Worksheets(stMonth).Activate line.

    i.e. On Error Resume Next

    This will prevent the macro 'falling over' if the February sheet doesn't exist

    Did you put the code in the Workbook_Open event?

    Rgds

  5. #5
    Registered User
    Join Date
    10-03-2007
    Posts
    20
    Ah!

    Working like a charm. Cheers, for that.

    One other question though... Can I name the Worksheets, "Feb" rather then "February" and have it still pick up the value?

    Rob

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by RobMarshall
    Ah!

    Working like a charm. Cheers, for that.

    One other question though... Can I name the Worksheets, "Feb" rather then "February" and have it still pick up the value?

    Rob
    Hi Rob,

    Yes, that's just as simple. Just change the format bit of the code from

    Format(Date, "mmmm") to

    Format(Date, "mmm")

    i.e. three 'm's not four

    Rgds

+ 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