I found the below code which I have modified slightly for my needs. The issue I'm having is it doesn't do exactly what I'd like. Specifically, I have a drop down menu in A1 of each sheet with the names of the three sheets, Shipping, Orders, and Inventory in my workbook. What I'm trying to accomplish is whenever a user selects a drop down menu item regardless of the sheet they are working in, the relevant sheet is shown and the other two are hidden.
The below code works, but only if all three sheets have the same sheet name in the drop down selected, which becomes untenable when two sheets get hidden. I'm not exactly sure how to overcome this, but hopefully someone here who is much better at this than I am will have some advice.
Current VB Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = "Shipping" Then
Sheets("Shipping").Visible = True
Sheets("Orders").Visible = False
Sheets("Inventory").Visible = False
ElseIf Target.Value = "Orders" Then
Sheets("Orders").Visible = True
Sheets("Shipping").Visible = False
Sheets("Inventory").Visible = False
ElseIf Target.Value = "Inventory" Then
Sheets("Inventory").Visible = True
Sheets("Shipping").Visible = False
Sheets("Orders").Visible = False
End If
End Sub