george hart
Board Regular
- Joined
- Dec 4, 2008
- Messages
- 241
Hi all....Thanks in advance...
Is there a way I can change the code below where it reads "xlBetween, Formula1:="=$A$2:$A$21"" to something like Worksheets("Lookup").Range("A1:A50")?
In short I need certain cells validated, but the validation range is on another worksheet which is hidden.
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$A$2:$A$21"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
Is there a way I can change the code below where it reads "xlBetween, Formula1:="=$A$2:$A$21"" to something like Worksheets("Lookup").Range("A1:A50")?
In short I need certain cells validated, but the validation range is on another worksheet which is hidden.
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$A$2:$A$21"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub