Thread: hiding sheets
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default hiding sheets

Hi Steve,

Try:

'==============
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range

Set rng = Me.Range("H45")

If Not Intersect(rng, Target) Is Nothing Then
Sheets("Detail INFO").Visible = LCase(rng.Value) = "x"
End If

End Sub
'<<==============

---
Regards,
Norman


"steve" wrote in message
...
I have a box in sheet named "General INFO"

If an "X" or "x" is entered into this box, then a hidden sheet named
"Detail
INFO" becomes visible.

The code looks like this:

If Sheets("General INFO").Range("H45").Value = "X" Then
Sheets("Detail INFO").Visible = True
Else: Sheets("Detail INFO").Visible = False
End If

First, I don't knwo how to include "x" as well as "X"

Second, what sub do i put this under? there is no button to activate, i
just want this to always apply to the sheet. like as soon as x is
entered,
the sheet is visible.

I was using
Private Sub Worksheet_Change(ByVal Target As Range)

but this created an error when i typed in other cells besides H45. This
probably easy for you guys, but i'm pretty new at this.

Thanks for any help
Steve