No, the DV creation fails if the name range doesn't exist.
But you could temporarily create it and point it at the DV cell
Range(strRange).Select
Range(strRange).Name = strNamedRange
Range(strRange).Validation.Delete
Range(strRange).Validation.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="=" & strNamedRange
ThisWorkbook.Names(strNamedRange).Delete
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"greg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
> I am trying to create a data validation drop down. To a named range.
>
> Range(strRange).Select
> Range(strRange).Validation.Delete
> Range(strRange).Validation.Add Type:=xlValidateList,
> AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=" &
> strNamedRange
>
>
>
> However the named range has not yet been created.
> Is there a way to assign the data validation. Then later create the
> range.
> and fill the range.
> then somehow do an update to the validation?
>
> thanks
>
>
>
|