Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default merging multiple named ranges for validation list

Hello

I have 2 named ranges and I like to have a validation in a cell (list
validation) wich refers to both ranges. The named ranges are on
different pages (sheets). I like not to use a separate 3rd column as
temporary source (which has alle entries from the other two names
ranges). Instead I like to merge named ranges ad hoc with some
vbscript. Exists there a way?

i.e. the following is just for illustration

Validation Function "As List"
=mergeRanges(rangeA;rangeB)

function mergeRanges(r1 as Range, r2 as Range) As Range

Dim rTarget = new Range

' merge the two ranges r1,r2 to rTarget

mergeRanges = rTarget

end Function

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default merging multiple named ranges for validation list

I don't think so. You can't use multiple areas manually either.

But you could build that range (in code) on a helper worksheet, then use that in
your data|validation.

If the range changes sizes, maybe rebuild it each time the workbook opens (or
when the ranges change)???

joes wrote:

Hello

I have 2 named ranges and I like to have a validation in a cell (list
validation) wich refers to both ranges. The named ranges are on
different pages (sheets). I like not to use a separate 3rd column as
temporary source (which has alle entries from the other two names
ranges). Instead I like to merge named ranges ad hoc with some
vbscript. Exists there a way?

i.e. the following is just for illustration

Validation Function "As List"
=mergeRanges(rangeA;rangeB)

function mergeRanges(r1 as Range, r2 as Range) As Range

Dim rTarget = new Range

' merge the two ranges r1,r2 to rTarget

mergeRanges = rTarget

end Function


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation List - Can I have multiple ranges displayed? Jim Excel Worksheet Functions 4 March 24th 10 11:46 AM
Validation list from Named Ranges Mik Excel Worksheet Functions 5 July 30th 09 10:32 PM
Named Ranges Not Working in Data Validation dplum Excel Worksheet Functions 8 November 24th 07 01:32 PM
How do I use Named Ranges as Data Validation Lists? Chris Mitchell Excel Worksheet Functions 2 June 23rd 07 12:15 PM
Validation protection with named ranges Ben H Excel Worksheet Functions 1 March 17th 06 03:49 AM


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"