ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom VBA Drop Downs (https://www.excelbanter.com/excel-programming/377345-custom-vba-drop-downs.html)

Nigel[_27_]

Custom VBA Drop Downs
 
ok .... so i need to make a custom drop down....

the actual drop down will be nowhere near the data that it is pulling
from (although it will be in the same sheet) so standard list, or
autofilter options are out....

the dropdown needs to list only unique names in a given range

and the range needs to be determined by variables...ie Range("A" & LPS
& ":F" & LPE)
where LPS and LPE are variable row numbers.....

im banging my head against a wall to figure this out......


Nigel[_27_]

Custom VBA Drop Downs
 
and actually...some of them WILL be in different worksheets... :/

On Nov 14, 4:35 pm, "Nigel" wrote:
ok .... so i need to make a custom drop down....

the actual drop down will be nowhere near the data that it is pulling
from (although it will be in the same sheet) so standard list, or
autofilter options are out....

the dropdown needs to list only unique names in a given range

and the range needs to be determined by variables...ie Range("A" & LPS
& ":F" & LPE)
where LPS and LPE are variable row numbers.....

im banging my head against a wall to figure this out......



Nigel[_27_]

Custom VBA Drop Downs
 
so i actually made some progress.....

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:="=A7:A" &
Range("EndOfProducts").Offset(-1, 0).Row
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = False

so you can see that the range of my validation data is populated by
variables...which is working great...

the problem is...i need to edit it so that my drop down only shows
unique items, and omits any blank cells....

is this possible?



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

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