Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Command button to open worksheet based on cell criteria

  1. #1
    New Member
    Join Date
    Oct 2018
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Command button to open worksheet based on cell criteria

    Hi, I need help with the following,

    Scenario: I Require a command button to open a worksheet based on the text in a particular cell.
    i.e. if cell b3 contains "apple", then open worksheet called "apple" only when the command button is clicked - (note cell b3 is a Data Validation box).

    I have searched & tried to put together bits and pieces but to no avail...

    Any help on this would be appreciated,

    Cheers,

  2. #2
    MrExcel MVP
    Join Date
    May 2009
    Posts
    15,713
    Post Thanks / Like
    Mentioned
    23 Post(s)
    Tagged
    5 Thread(s)

    Default Re: Command button to open worksheet based on cell criteria

    Put this in a standard module and assign it to a forms control command button on the sheet with the B3 data validation.
    Code:
    Sub ActivateSheet()
    On Error Resume Next
    Sheets(CStr([b3])).Activate
    On Error GoTo 0
    End Sub
    Joe

    When I was a young man I knew everything. Now that I'm older, I realize I know very little, and what I do know, I tend to forget!

  3. #3
    New Member
    Join Date
    Oct 2018
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Command button to open worksheet based on cell criteria

    Hey JoeMo,

    Legend, thank you, it is exactly what I am after, thanks for your help, I really appreciate it!

    Cheers,

  4. #4
    MrExcel MVP
    Join Date
    May 2009
    Posts
    15,713
    Post Thanks / Like
    Mentioned
    23 Post(s)
    Tagged
    5 Thread(s)

    Default Re: Command button to open worksheet based on cell criteria

    Quote Originally Posted by ccaliame View Post
    Hey JoeMo,

    Legend, thank you, it is exactly what I am after, thanks for your help, I really appreciate it!

    Cheers,
    You are welcome - thanks for the reply.
    Joe

    When I was a young man I knew everything. Now that I'm older, I realize I know very little, and what I do know, I tend to forget!

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •