Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Name in Data Validation
What is the proper way to refer to a range name on another worksheet (same
workbook), that you want to use as a drop-down list for data validation? I've tried everything to no avail. Here's what I have, that doesn't work (the range name I want to use is "StartTime"). Can someone advise what I'm doing wrong here? Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Range("$E$13:$E$36").Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=Worksheets("Range Names").Range("StartTime") .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "Invalid entry; please use the drop-down menu to select a response." .ShowInput = True .ShowError = True End With End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Name in Data Validation
Use the name not the range
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=StartTime" -- HTH RP (remove nothere from the email address if mailing direct) "Paige" wrote in message ... What is the proper way to refer to a range name on another worksheet (same workbook), that you want to use as a drop-down list for data validation? I've tried everything to no avail. Here's what I have, that doesn't work (the range name I want to use is "StartTime"). Can someone advise what I'm doing wrong here? Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Range("$E$13:$E$36").Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=Worksheets("Range Names").Range("StartTime") .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "Invalid entry; please use the drop-down menu to select a response." .ShowInput = True .ShowError = True End With End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range Name in Data Validation
Well don't I feel like an idiot. Thanks, Bob, and bless you!
"Bob Phillips" wrote: Use the name not the range .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=StartTime" -- HTH RP (remove nothere from the email address if mailing direct) "Paige" wrote in message ... What is the proper way to refer to a range name on another worksheet (same workbook), that you want to use as a drop-down list for data validation? I've tried everything to no avail. Here's what I have, that doesn't work (the range name I want to use is "StartTime"). Can someone advise what I'm doing wrong here? Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Range("$E$13:$E$36").Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=Worksheets("Range Names").Range("StartTime") .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "Invalid entry; please use the drop-down menu to select a response." .ShowInput = True .ShowError = True End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Validation Data using Validation Table cell range..... | Excel Discussion (Misc queries) | |||
Data Validation to range names for Chart Source Data | Charts and Charting in Excel | |||
Data Validation and Name Range | Excel Worksheet Functions | |||
Data Validation range | Excel Discussion (Misc queries) | |||
Dynamic Range for Data Validation | Excel Programming |