Results 1 to 8 of 8

ComboBox Value

Threaded View

  1. #1
    Registered User
    Join Date
    02-18-2019
    Location
    cleveland, oh
    MS-Off Ver
    2018
    Posts
    15

    ComboBox Value

    Hello all,

    I have the following code below, I want to be able to set some kind of autofilter on the drop down box to show only the given part number of "217230*".

    I tried including it in the Criteria1: field but did not work. I only want to see the part numbers "217230*" when you click on the drop down.

    Private Sub ComboBox1_Change()
    
    Sheets("RITE AID").Range("p1:z2000").ClearContents
      uf1.Caption = Me.ComboBox1.Text
      Application.ScreenUpdating = False
      Sheets("BOM").ListObjects("Table_BoM_Report___mi").Range.Copy
      Sheets("TRANS").Range("A1").PasteSpecial xlPasteValues
    Set src = Sheets("TRANS").Range("A1").CurrentRegion
    Set ws = Sheets("TRANS")
      ws.ListObjects.Add(SourceType:=xlSrcRange, Source:=src, xlListObjectHasHeaders:=xlYes, tablestyleName:="TableStyleMedium6").Name = "Table2"
    Set rtf = Sheets("TRANS").ListObjects("Table2").Range
      rtf.AutoFilter field:=1, Criteria1:=Me.ComboBox1.Value
    If Row.EntireRow.Hidden = False Then
    If rng Is Nothing Then Set rng = Row
       Set rng = Union(Row, rng)
    End If
    
    Next Row
    Set ws = Sheets("RITE AID")
      rng.Copy Destination:=ws.Range("P1")
      Set src = ws.Range("P1").CurrentRegion
      ws.ListObjects.Add(SourceType:=xlSrcRange, Source:=src, xlListObjectHasHeaders:=xlYes, tablestyleName:="TableStyleMedium6").Name = "Table3"
    Me.ListBox1.Clear
    With Me.ListBox1
      .List = Sheets("RITE AID").ListObjects("Table3").DataBodyRange.Value
      .ColumnCount = 6
      .ColumnWidths = "0,0,0,70,150,20"
    End With
    
    Sheets("RITE AID").Range("P1:z2000").ClearContents
    Sheets("RITE AID").Range("p1:z2000").Clear
    Sheets("RITE AID").Range("P1:Z2000").Interior.ColorIndex = 2
    Application.ScreenUpdating = True
    
    End Sub

    Thanks to all you reply,
    BLD
    Last edited by BLD21; 10-30-2019 at 10:49 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 03-22-2018, 11:25 AM
  2. [SOLVED] ComboBox to populate Listbox and 2nd Combobox based on 1st combobox dropdown choice
    By bbqqsmokeman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2017, 08:21 PM
  3. ComboBox values source being changed based on another combobox selection in a UserForm
    By stephenanderson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2016, 11:12 PM
  4. [SOLVED] Code required to Auto Populate 3rd Combobox based on 02nd Combobox Selection
    By bimmy80 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-14-2015, 03:56 AM
  5. Replies: 1
    Last Post: 11-07-2014, 01:21 PM
  6. Userform Combobox to populate form: Can I change the order of the columns in the combobox?
    By CraigWiggins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2014, 12:14 PM
  7. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM

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