+ Reply to Thread
Results 1 to 2 of 2

Running a macro on combo box selection to view different worksheets

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago Land
    MS-Off Ver
    Excel 2007
    Posts
    5

    Running a macro on combo box selection to view different worksheets

    I currently have 4 worksheets for the summary of my data. In each of them I have a combox that has a list of each worksheet. When I select a certain worksheet I want it to go to that worksheet. Here is what I have for code but I can't get it to work. Any help would be greatly appreciatied.



    For the Macro I have:

    Public Sub Select_Brand()

    If Brand = "BV" Then
    Sheets("BV").Select
    ElseIf Brand = "FAX" Then
    Sheets("FAX").Select
    ElseIf Brand = "FWD" Then
    Sheets("FWD").Select
    ElseIf Brand = "PA" Then
    Sheets("PA").Select
    End If

    End Sub



    For the ComboBox on each worksheet I have this code:

    Private Sub ComboBox1_Click()
    Brand = ComboBox1.Value
    Call Select_Brand
    ComboBox1.Value = ""
    End Sub

    Thanks

    Marc

  2. #2
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago Land
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Running a macro on combo box selection to view different worksheets

    I figured it out. I forgot to declare a variable.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1