ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Join non-contiguous ranges into one range via named range? (https://www.excelbanter.com/excel-discussion-misc-queries/229411-join-non-contiguous-ranges-into-one-range-via-named-range.html)

ker_01

Join non-contiguous ranges into one range via named range?
 
I'm certain that I did this some years ago, but can't recall how.

I have two separate (non-contiguous) ranges that I need Excel to see as one
range so I can use it as the source for a data validation list.

I've tried the obvious, such as comma, semicolon, colon, ampersand, but
either my syntax is wrong, or none of those are the right way to do it.

Any suggestions?

Thanks!
Keith

Gary''s Student

Join non-contiguous ranges into one range via named range?
 
This is one way to make a range out of two pieces:

Sub rangeRover()
Set r = Range("A1:A10,C1:C4")
r.Select
End Sub

--
Gary''s Student - gsnu200850


"ker_01" wrote:

I'm certain that I did this some years ago, but can't recall how.

I have two separate (non-contiguous) ranges that I need Excel to see as one
range so I can use it as the source for a data validation list.

I've tried the obvious, such as comma, semicolon, colon, ampersand, but
either my syntax is wrong, or none of those are the right way to do it.

Any suggestions?

Thanks!
Keith


Dave Peterson

Join non-contiguous ranges into one range via named range?
 
Maybe you can create a contiguous range on another (hidden?) worksheet. You
could use formulas that point back to the original ranges. Then use this for
the data|validation list source.

Or maybe you could use code to apply the data|validation. The code would create
the comma separated list -- just like you typed it by hand.

But that would suffer the same restrictions (not too long and no commas in any
of the strings and case sensitive) that you get when you do it manually. And
the code would have to reapply the Data|Validation if you changed any of the
values in either range.

ker_01 wrote:

I'm certain that I did this some years ago, but can't recall how.

I have two separate (non-contiguous) ranges that I need Excel to see as one
range so I can use it as the source for a data validation list.

I've tried the obvious, such as comma, semicolon, colon, ampersand, but
either my syntax is wrong, or none of those are the right way to do it.

Any suggestions?

Thanks!
Keith


--

Dave Peterson

Roger Govier[_3_]

Join non-contiguous ranges into one range via named range?
 
Hi Keith

I put a coded solution to you problem at the end of your previous thread on
this matter.

--
Regards
Roger Govier

"ker_01" wrote in message
...
I'm certain that I did this some years ago, but can't recall how.

I have two separate (non-contiguous) ranges that I need Excel to see as
one
range so I can use it as the source for a data validation list.

I've tried the obvious, such as comma, semicolon, colon, ampersand, but
either my syntax is wrong, or none of those are the right way to do it.

Any suggestions?

Thanks!
Keith




All times are GMT +1. The time now is 06:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com