Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default data validation and named range

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default data validation and named range

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
data validation using named range from another file pat67 Excel Worksheet Functions 3 April 13th 10 06:56 PM
Dynamic Named Range inside a Data Validation list ? Richard[_34_] Excel Programming 5 March 11th 06 01:58 PM
Using a data validation list to look up a defined named range in another worksheet Laura Hunt Charts and Charting in Excel 0 November 24th 05 02:29 PM
Data validation named range update Phil Deem Excel Programming 2 July 18th 05 02:56 PM
Data validation named range update Phil Deem Excel Discussion (Misc queries) 3 July 16th 05 03:55 AM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"