View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default how can I unhide/hide a sheet based on pull down selection?

With a DV dropdown list of sheets in D1 of an always visible sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("D1")) Is Nothing Then Exit Sub
On Error GoTo endit
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
With Sheets(Target.Value)
If .Visible = False Then
.Visible = True
Else
.Visible = False
End If
End With
endit:
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the code into that sheet module.

Adjust target range to suit.

Alt + q to return to the Excel window.


Gord Dibben MS Excel MVP


On Mon, 11 Aug 2008 18:40:09 -0700, Keith
wrote:

I would like to know how you can make one of several hidden worksheets
visible based on a pull down selection on a visible worksheet.