Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am trying to set up a list cell validation on my worksheet based on a dynamic named range.
I am getting an error with the line in red. ("Application-defined or object-defined error.)
I assume it's because it's looking for a named range "str_vlist" which doesn't exist. How do I adjust this code to apply the range named as represented by the variable str_vlist?
Rich (BB code):
str_vlist = "nm_acct_" & Range("M9").Value
Range("O9:P9").Locked = False
Range("O9").Validation.Delete
Range("O9").Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Formula1:=("=str_vlist")
I am getting an error with the line in red. ("Application-defined or object-defined error.)
I assume it's because it's looking for a named range "str_vlist" which doesn't exist. How do I adjust this code to apply the range named as represented by the variable str_vlist?