PDA

View Full Version : [SOLVED] Hide Unhide with a twist



Juriemagic
06-19-2015, 03:41 AM
Hi good people,

I have a rather strange scenario. Please look at the attachment. We have Sheet1 and Sheet2. Only 1 sheet shows at a time. When cell C1, on Sheet1, is intersected, a message box appears which says "click me". Up to this point all is fine. What I would like to happen is, when the "OK" is clicked, I need both Sheet1 and Sheet2 un-hidden. Please help me with this. Thank you all greatly!

snb
06-19-2015, 04:05 AM
Remove all code.
Use

Sub ShowSheet()
Sheets("Sheet" & IIf(ActiveSheet.Name = "Sheet1", "2", "1")).Visible = True
ActiveSheet.Visible = False
End Sub

Juriemagic
06-19-2015, 06:18 AM
Thanx snb,

I just had to change the
ActiveSheet.Visible = False to
ActiveSheet.Visible = True. It's working great, thank you..