Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding first value in named range referred to in data validation list
I have a cell that uses data validation (list) which points at a named range
that represents a range on a different worksheet. I need to be able to reset the cell value to the first value on the named range list. Here is my sample code, which isn't working: S = Sheet12.Range("E2").Validation.Formula1 Sheet12.Range("E2").Value = Range(S)(1) debug.print Sheet12.Range("E2").Validation.Formula1 results in the named range =DatesForSelection14days when I use the immediate window to set: S = Sheet12.Range("E2").Validation.Formula1 then debug.print Range(S)(1) I get 10/3/2008 which is correct. But when the two lines of code run within the sub itself, on the second line I get a run-time error 1004, method 'Range' of object '_worksheet' failed huh? Any advice greatly appreciated. Thanks, Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data Validation List from a Dynamic Named Range on Another Workshe | Excel Worksheet Functions | |||
Dynamic Named Range inside a Data Validation list ? | Excel Programming | |||
Cell value as named range for validation list | Excel Programming | |||
Using a data validation list to look up a defined named range in another worksheet | Charts and Charting in Excel | |||
named range, data validation: list non-selected items, and new added items | Excel Discussion (Misc queries) |