PC Review


Reply
Thread Tools Rate Thread

data validation and named range

 
 
greg
Guest
Posts: n/a
 
      13th Jul 2007
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



 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      13th Jul 2007
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
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
data validation using named range from another file pat67 Microsoft Excel Worksheet Functions 3 13th Apr 2010 06:56 PM
Data validation named range update =?Utf-8?B?UGhpbCBEZWVt?= Microsoft Excel Programming 2 18th Jul 2005 02:56 PM
Data validation named range update =?Utf-8?B?UGhpbCBEZWVt?= Microsoft Excel Misc 3 16th Jul 2005 03:55 AM
(repost) Data Validation and Named range. rob nobel Microsoft Excel Misc 3 26th Nov 2003 10:37 PM
Data validation and Named Range rob nobel Microsoft Excel Misc 3 21st Nov 2003 01:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:32 AM.