Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fine Tuning
Hi...
The code below loads and unloads a sheet (to be visible to or not) depending on a value entered into the Frontpage Sheet. How can I modify this so the same value will make visible (or not) more sheets called R,A,B,Ba,Rs,Co,Bf,Bs,Pa,Pt,Pa,Ea. Is this easy to do? I'm trying to get users to enter a user number so that only they can use what I've created. Private Sub Worksheet_Calculate() Dim sh As Worksheet Set sh = Worksheets("FRONTPAGE") With Sheets("Spa") If sh.Range("e21").Value = 1 Then .Visible = xlSheetHidden ElseIf sh.Range("e21").Value = 0 Then .Visible = xlSheetVisible End If End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fine Tuning
Hi
Try if this is what you want: Private Sub Worksheet_Calculate() Dim sh As Worksheet SheetArray = Array("R", "A", "B", "Ba", "Rs", "Co", _ "Bf", "Bs", "Pa", "Pt", "Pa", "Ea", "Spa") Set sh = Worksheets("FRONTPAGE") For sht = LBound(SheetArray) To UBound(SheetArray) With Sheets(SheetArray(sht)) If sh.Range("e21").Value = 1 Then .Visible = xlSheetHidden ElseIf sh.Range("e21").Value = 0 Then .Visible = xlSheetVisible End If End With Next End Sub Regards, Per "Gordon" skrev i meddelelsen ... Hi... The code below loads and unloads a sheet (to be visible to or not) depending on a value entered into the Frontpage Sheet. How can I modify this so the same value will make visible (or not) more sheets called R,A,B,Ba,Rs,Co,Bf,Bs,Pa,Pt,Pa,Ea. Is this easy to do? I'm trying to get users to enter a user number so that only they can use what I've created. Private Sub Worksheet_Calculate() Dim sh As Worksheet Set sh = Worksheets("FRONTPAGE") With Sheets("Spa") If sh.Range("e21").Value = 1 Then .Visible = xlSheetHidden ElseIf sh.Range("e21").Value = 0 Then .Visible = xlSheetVisible End If End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro fine Run fine from Select but not from KB Shortcut? | Excel Discussion (Misc queries) | |||
help w/ fine tuning | New Users to Excel | |||
Fine tuning if statement.... | Excel Programming | |||
Fine-tuning selection change event for merged cells & wrap text | Excel Programming | |||
Tuning Off Toolbars | Excel Programming |