Range Name in Data Validation

P

Paige

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top