Unhide a Sheet Based on a Cell Dropdown

tomexcel1

New Member
Joined
Feb 22, 2018
Messages
47
Hi All

I have a 13 hidden sheets in my workbook, Based on the users input the correct sheet to unhide shows in sheet6 cell E10 ie (Upload A or Upload B etc).

My question is using VBA how can I make clicking a button unhide the correct sheet?

Any help is much appreciated! Thanks

Tom
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.Address(0, 0) = "E10" And Target.Value <> "" Then
      If Evaluate("isref('" & Target.Value & "'!A1)") Then
         Sheets(Target.Value).Visible = True
      Else
         MsgBox "Sheet " & Target.Value & " doesn't exists"
      End If
   End If
End Sub
This needs to go in the sheet module for sheet6
 
Upvote 0
Try
Code:
Sub tomexcel1()
   With Sheets("Sheet6").Range("E10")
      If .Value <> "" Then
         If Evaluate("isref('" & .Value & "'!A1)") Then
            Sheets(.Value).Visible = True
         Else
            MsgBox "Sheet " & .Value & " doesn't exists"
         End If
      End If
   End With
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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