Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get the list from Autofilter after filter some criteria

Dear All and MVPs, I have created my userform and there are some dropdown box
there. In order to ease and simply user on selecting, this userform works
similarly and base on Autofilter from the workbook. E.g., a file contains
Company Name and Product Name. Since some companies may carry more than one
product, after user selected the company on my userform, the product
Combo(dropdown) listbox only shows the product(s) the company carries. My
method is using Autofilter on the worksheet and set the criteria as the user
selection on the workbook. How can I get the autofilter list from the Excel
autofiler? Or I have to do looping to check? Please advise. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Get the list from Autofilter after filter some criteria

I'd just loop through the range...

Option Explicit
Private Sub ComboBox1_Change()

Dim myRng As Range
Dim myCell As Range

Me.ComboBox2.Clear

With Worksheets("sheet1")
Set myRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myRng.Cells
If LCase(myCell.Value) = LCase(Me.ComboBox1.Value) Then
Me.ComboBox2.AddItem myCell.Offset(0, 1).Value
End If
Next myCell

End Sub

I matched up on column A and took the value from column B.

hanawakun wrote:

Dear All and MVPs, I have created my userform and there are some dropdown box
there. In order to ease and simply user on selecting, this userform works
similarly and base on Autofilter from the workbook. E.g., a file contains
Company Name and Product Name. Since some companies may carry more than one
product, after user selected the company on my userform, the product
Combo(dropdown) listbox only shows the product(s) the company carries. My
method is using Autofilter on the worksheet and set the criteria as the user
selection on the workbook. How can I get the autofilter list from the Excel
autofiler? Or I have to do looping to check? Please advise. Thanks in advance.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to filter list based on multiple criteria JSBPL New Users to Excel 1 July 21st 09 10:16 AM
use list of criteria in filter Seeker Excel Discussion (Misc queries) 0 May 10th 09 11:06 AM
AutoFilter Pull Criteria from one sheet and custom filter on other dtg_denver Excel Programming 8 August 20th 05 10:47 PM
Improve autofilter combine conditionals with filter criteria dmcauli3 Excel Worksheet Functions 0 May 13th 05 01:27 PM
Product Price List with 14k records, filter w/out using AutoFilter ChrisSeattle Excel Worksheet Functions 1 March 3rd 05 06:46 PM


All times are GMT +1. The time now is 08:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"