View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Unhide worksheet IF

The code Mike provided is not event code. It must be copied to a general module
and run manually.

Paste this into your "Forms" sheet module by right-click on sheet tab and "View
Code"

Private Sub Worksheet_Change(ByVal Target As Range)
If Me.Range("C24").Value = "" Then
Worksheets("Discount").Visible = xlSheetVeryHidden
Else
Worksheets("Discount").Visible = xlSheetVisible
End If
End Sub


Gord Dibben MS Excel MVP


On Wed, 2 Apr 2008 02:28:01 -0700, Marilyn
wrote:

Thanks Mike
I copied your code to the worksheet named Forms and it does not work. What
did I do wrong
"Mike" wrote:

Sub peekaboo()
On Error Resume Next
If Worksheets("Forms").Range("C24").Value = "" Then
Worksheets("Discount").Visible = xlSheetVeryHidden
Else
Worksheets("Discount").Visible = xlSheetVisible
End If
End Sub

"Marilyn" wrote:

Hi I have a work book (which has several worksheets) and the Worksheet
named “Discount” is hidden.. One of the tabs is named “Form” . On C 24 of
the Form tab I have a dropdown validation list which includes 3 choices, (a
blank space , Yes, No) . What I want to do is if C24 says Yes or NO on the
Form worksheet then unhide the worksheet entitled “Discount” . If C 24 is
blank hide the worksheet named “Discount” Help with code please .Thanks in
advance