Command button to open worksheet based on cell criteria

ccaliame

New Member
Joined
Oct 11, 2018
Messages
2
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,
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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
 
Upvote 0
Hey JoeMo,

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

Cheers,
 
Upvote 0

Forum statistics

Threads
1,215,268
Messages
6,123,965
Members
449,137
Latest member
yeti1016

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top