Microsoft Excel Webinar

Results 1 to 3 of 3

Thread: Solved: Populating Combobox with Filtered Data

  1. #1

    Solved: Populating Combobox with Filtered Data

    I am attempting to populate a second combobox with information that has been filtered from a selected value within the first combobox.

    So far... I've been unsuccessful.

    VB:
    Private Sub Owner_afterupdate() 
        Sheets("savedwork").Activate 
        With Range("a:a", Range("a4:a" & Rows.Count).End(xlUp)) 
            .AutoFilter 1, Owner.Value 
        End With 
        Dim LastRow As Long 
        With Worksheets("savedwork") 
            LastRow = .Range("B" & Rows.Count).End(xlUp).Row 
             
            FacilityID.RowSource = .Range("B2:B" & LastRow) 
        End With 
         
    End Sub 
    
    
    Formatting tags added by mark007

  2. #2
    (The Combobox's are on a userform)

  3. #3
    I got it....

    VB:
    Dim cLoc As Range 
    Dim ws As Worksheet 
    Set ws = Worksheets("listssheet") 
    On Error Goto line1: 
    For Each cLoc In ws.Range("facilityidlist") 
        With Me.FacilityID 
            .AddItem cLoc.Value 
        End With 
    Next cLoc 
    line1: 
    
    
    Formatting tags added by mark007
    Thanks !!

Posting Permissions

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