Creating filtered list for Dropdown box

haplc

Board Regular
Joined
May 27, 2004
Messages
71
Dear All,

I have two dropdwons: CVolt and CPilot.
On change of value in CVolt, it is opening a sheet (in the same excel workbook) "Pilot" and filtering coloumn 4 using value from the dropwndown value

Result should be that the list of drowndown "Cpilot" should contain the row fitlered using CVolt value.
It is working good but issue is: I am seeing the list if all the filtered rows are one after other. i.e. if first 4 row contains same criteria then they all four rows are visibile as the list of CPilot.
But if the rows are located at lets say in row # 1, 2 and then 6, 7, I am able to see only row 1 & 2 as list of Cpilot and Iam not able to see row 6 &7 (despite these rows are also having same value as row 1 &2.)
In the excel sheet "Pilot", I am able to see all rows 1, 2, 6 and 7.

Here is code for "on change" of dropdown "CVolt":

' clearing existing fillter
ThisWorkbook.Worksheets("Pilot").Range("a1:d1").AutoFilter Field:=4, Criteria1:="*", visibledropdown:=True

' setting filter based on the value selected in CVolt dropdown
ThisWorkbook.Worksheets("Pilot").Range("a1:d1").AutoFilter Field:=4, Criteria1:=Myform.CCVolt.Value, visibledropdown:=True

' setting list of dropdown CPilot using filtered value set by CVolt from excel sheet "Pilot"
Myform.CPilot.List = Worksheets("Pilot").Range("a2:b" & (ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row)).SpecialCells(xlCellTypeVisible).Value

thanking you in advance
Best regards
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,214,877
Messages
6,122,051
Members
449,064
Latest member
scottdog129

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top