ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Union Method with multiple worksheets (https://www.excelbanter.com/excel-programming/311866-union-method-multiple-worksheets.html)

Jeff B[_2_]

Union Method with multiple worksheets
 
I can easily form a "union" of ranges on the same worksheet but bwtween range
on two or more sheets. I get a 1004 error anyway I try it.

Any ideas on how to do this?

Set R2 = Worksheets(1).Range("a22:a200")
Set R1 = Worksheets(2).Range("B2:B22")
Set rngUnion = Union(R1, R2)

--
Jeff B

Norman Jones

Union Method with multiple worksheets
 
Hi Jeff,

I do not believe that a range object can be 3D and, therefore, a union is
consrtained to a single sheet.

---
Regards,
Norman



"Jeff B" wrote in message
...
I can easily form a "union" of ranges on the same worksheet but bwtween
range
on two or more sheets. I get a 1004 error anyway I try it.

Any ideas on how to do this?

Set R2 = Worksheets(1).Range("a22:a200")
Set R1 = Worksheets(2).Range("B2:B22")
Set rngUnion = Union(R1, R2)

--
Jeff B




Tom Ogilvy

Union Method with multiple worksheets
 
Just to add a thought.
The parent of a range is a worksheet. Since the union returns a range, it
would not be able to have a parent if the union were composed of multiple
sheets.

--
Regards,
Tom Ogilvy


"Norman Jones" wrote in message
...
Hi Jeff,

I do not believe that a range object can be 3D and, therefore, a union is
consrtained to a single sheet.

---
Regards,
Norman



"Jeff B" wrote in message
...
I can easily form a "union" of ranges on the same worksheet but bwtween
range
on two or more sheets. I get a 1004 error anyway I try it.

Any ideas on how to do this?

Set R2 = Worksheets(1).Range("a22:a200")
Set R1 = Worksheets(2).Range("B2:B22")
Set rngUnion = Union(R1, R2)

--
Jeff B






Norman Jones

Union Method with multiple worksheets
 
Hi Tom,

I prefer your explanation.

---
Regards,
Norman



"Tom Ogilvy" wrote in message
...
Just to add a thought.
The parent of a range is a worksheet. Since the union returns a range, it
would not be able to have a parent if the union were composed of multiple
sheets.

--
Regards,
Tom Ogilvy


"Norman Jones" wrote in message
...
Hi Jeff,

I do not believe that a range object can be 3D and, therefore, a union is
consrtained to a single sheet.

---
Regards,
Norman



"Jeff B" wrote in message
...
I can easily form a "union" of ranges on the same worksheet but bwtween
range
on two or more sheets. I get a 1004 error anyway I try it.

Any ideas on how to do this?

Set R2 = Worksheets(1).Range("a22:a200")
Set R1 = Worksheets(2).Range("B2:B22")
Set rngUnion = Union(R1, R2)

--
Jeff B









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

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