Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dropdown List Linked to Sheets (2002)

    Hi - I have the following macro that links whatever is chosen in the dropdown list to the corresponding worksheet. I would like to hide the other worksheets when the selection in the dropdown list is changed. Please help!

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$B$10" Then
    Sheets(Target.Value).Visible = True
    Sheets(Target.Value).Activate
    End If
    End Sub

    Thanks!!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dropdown List Linked to Sheets (2002)

    Try this version:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim wsh As Worksheet

    On Error GoTo ExitHere

    If Target.Address = "$B$10" Then
    Application.EnableEvents = False
    Sheets(Target.Value).Visible = True
    Sheets(Target.Value).Activate
    For Each wsh In Worksheets
    If Not wsh.Name = Target.Value Then
    wsh.Visible = False
    End If
    Next wsh
    End If

    ExitHere:
    Application.EnableEvents = True
    End Sub

  3. #3
    New Lounger
    Join Date
    Sep 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dropdown List Linked to Sheets (2002)

    that works wonderfully, thanks so much!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •