ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dropdown List from values in a Cell Range (https://www.excelbanter.com/excel-programming/369793-dropdown-list-values-cell-range.html)

DrKacso

Dropdown List from values in a Cell Range
 
How do I get a list of only the nonblank values from a cell range?

moon[_5_]

Dropdown List from values in a Cell Range
 

For Each YourCell in YourRange
If ActiveCell.Value < Empty Then
YourCombo.AddItem ActiveCell.Value
End If
Next


"DrKacso" schreef in bericht
...
How do I get a list of only the nonblank values from a cell range?




Simon Lloyd[_853_]

Dropdown List from values in a Cell Range
 

Based on your question, Try........................

Range("YOUR RANGE").Select
Selection.AutoFilter 'Turns on AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<" 'Selects not equa
to blank
Selection.AutoFilter 'Turns AutoFilter off, you dont need this en
bit as your selection will become unfiltered as soon as the code get
here!

Regards,
Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=56965



All times are GMT +1. The time now is 01:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com