insomniac53
Board Regular
- Joined
- Sep 3, 2013
- Messages
- 104
I am trying to create a dropdown validation list on a sheet cell (not a form) using a function rather than a constant. I am doing this because the validation will be repeated on the same sheet for various columns, so rather than create 20+ Names, I thought I might be able to write a function which returns a string, identical to a constant string. So, the constant Name for column I is 'ValidCategories' and refers to this range:
The function (abridged) is:
The string function works okay, but the validation needs a specified list or Name. Is there a way around this or do I need a different approach?
Thanks
Code:
='Lists Sheet'!$I$2:INDEX('Lists Sheet'!$I:$I,MATCH(REPT("z",255),'Lists Sheet'!$I:$I))
Code:
Public Function Valid_Range(id As Integer) As String
'id selects the appropriate column
Dim s as String
's creates same string as above for the selected column
Valid_Range = s
End Function
Thanks