+ Reply to Thread
Results 1 to 10 of 10

A button to switch to a worksheet

  1. #1
    Registered User
    Join Date
    07-13-2008
    Location
    UK
    Posts
    2

    A button to switch to a worksheet

    Hello,

    I have made a little program for a customer at work which has 4 different worksheets. Each worksheet works out a cost based on different prices.

    I would like to make a 'Welcome' worksheet, with buttons on it so my customer can click the button which corresponds to the option he would like to cost, and then excel automatically selects that worksheet.

    Is this possible? I know how to create buttons but don't know the code to but behind it. It would be nice to also hide the other 3 worksheets when they have not been selected by the welcome page.

    Thanks for any assistance.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Use hyperlinks, these can be attached to an image. No VBA would be needed.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    Quote Originally Posted by Coup
    Hello,

    I have made a little program for a customer at work which has 4 different worksheets. Each worksheet works out a cost based on different prices.

    I would like to make a 'Welcome' worksheet, with buttons on it so my customer can click the button which corresponds to the option he would like to cost, and then excel automatically selects that worksheet.

    Is this possible? I know how to create buttons but don't know the code to but behind it. It would be nice to also hide the other 3 worksheets when they have not been selected by the welcome page.

    Thanks for any assistance.
    Hi Coup,
    You don't need a button tho go anywhere in the workbok, you can create hyperlinks.
    Select a cell and right click the mouse, select Hyperlink
    at the side select place in this document, enter where you want to hyperlink to and enter he text you want to display.
    If you still want to use buttons then code like this will work
    Please Login or Register  to view this content.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I don't understand how to hyperlink between sheets.

    I right click a cell
    Select Hyperlink
    Enter Sheet2!A1

    The cell shows Sheet2!A1 but not the value in that cell. Clicking on that "Cannot open the specified file"

    What am I misunderstading?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    Quote Originally Posted by mikerickson
    I don't understand how to hyperlink between sheets.

    I right click a cell
    Select Hyperlink
    Enter Sheet2!A1

    The cell shows Sheet2!A1 but not the value in that cell. Clicking on that "Cannot open the specified file"

    What am I misunderstading?
    If you wanted the text to display B2, enter =b2 in the text to display box
    or
    =Sheet2!B2

    but the cell reference can be somewhere else
    Last edited by davesexcel; 07-13-2008 at 11:53 AM.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I think I've got that sorted, but how is this different than just using a spreadsheet formula.

    What does hyperlinking to Sheet2!A1 do differently than the formula =Sheet2!A1?

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    Quote Originally Posted by mikerickson
    I think I've got that sorted, but how is this different than just using a spreadsheet formula.

    What does hyperlinking to Sheet2!A1 do differently than the formula =Sheet2!A1?
    I believe the original question was to Click a button and going to the sheet which involves VBA, my answer was to use a hyperlink to go to the sheet then VBA would not be required.
    I am confused with the question.
    If you wanted a hyperlink formula then...
    This formula would hyperlink to one range but use another range as the text for the hyperlink cell...ie:
    =HYPERLINK("#Sheet2!A1",Sheet1!E1)
    when clicked you would go to",Sheet2!A1
    but the text in the hyperlink cell would be
    Sheet1!E1

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Thanks, I didn't know that HYPERLINK could do that.
    Thank you.

  9. #9
    Registered User
    Join Date
    07-13-2008
    Location
    UK
    Posts
    2
    thank you for the advice. i went with dave's vba code for the macro buttons and my workbook now works as i want it to.

    i did try with hyperlinks but i don't seem to be the only person who couldnt get them to work as described.

    thanks.

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    Quote Originally Posted by Coup
    thank you for the advice. i went with dave's vba code for the macro buttons and my workbook now works as i want it to.

    i did try with hyperlinks but i don't seem to be the only person who couldn't get them to work as described.

    thanks.
    I doubt if that is the case.....

+ 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