(Using Office 2003 on XP Pro) I have two named ranges that I want to union into one big named range so that I can use the big named range in a validation table. Unfortunately the big range does not appear on the list of named range so I switched to VBA to try and lick this but really I was hoping a non-VBA solution exists. Exploring possible VBA solutions, here is what I have so far:This code works and BigRange is created but when I attempt to use it in a validation table an error states that the range is not contiguous (or something to that effect.).![]()
Please Login or Register to view this content.
Notice I used a worksheet ACTIVATE event. The validation is on Sheet2, the data for columns A & B are on Sheet1, by using the ACTIVATE event the code will refresh BigRange each time Sheet2 is activated which is necessary since the data on sheet1 can be changed at anytime.
Back to a non-VBA solution, I tried to concatenate two named ranges in the "source:" field of data validation dialog. I tried to input: =SmallRange1, SmallRange2 and excel reported this was no good and to use a delimiter but I cannot determine what the correct delimiter is. If a delimiter works then this would be a preferred solution over a VBA solution.
If there is no straightforward solution then I plan to write a VBA solution that builds one contiguous list from columns A and B and then saves a named range from that. But I want to hold off and see if anyone has a nicer solution.
Thanks for taking the time to read this!
Bookmarks