Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Union Function

I am trying to combine data on two different sheets in the same workbook
using the following command:
Set Union_sh = Application.Union(Sheets("BSPL+"), Sheets("Other OMI"))

For some reason this won't work and I cannot understand why.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Union Function

First, the Union method requires Range object arguments, not Sheet
objects.

Second, the Union method returns a Range object, which is a child object
of a Sheet. You can't have a Range Object that has two parent (sheet)
objects.



In article ,
NutoVBA wrote:

I am trying to combine data on two different sheets in the same workbook
using the following command:
Set Union_sh = Application.Union(Sheets("BSPL+"), Sheets("Other OMI"))

For some reason this won't work and I cannot understand why.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Union Function

Do you have any ideas on how to identify a sheet as a Range?

"JE McGimpsey" wrote:

First, the Union method requires Range object arguments, not Sheet
objects.

Second, the Union method returns a Range object, which is a child object
of a Sheet. You can't have a Range Object that has two parent (sheet)
objects.



In article ,
NutoVBA wrote:

I am trying to combine data on two different sheets in the same workbook
using the following command:
Set Union_sh = Application.Union(Sheets("BSPL+"), Sheets("Other OMI"))

For some reason this won't work and I cannot understand why.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Union Function

Sheet Objects and Range Objects are not, and cannot be made equivalent.

You can return a range object consisting of all cells on a sheet with

Sheets("Sheet1").Cells



In article ,
NutoVBA wrote:

Do you have any ideas on how to identify a sheet as a Range?

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
Error using 'Union' JNW Excel Programming 4 August 25th 06 03:39 PM
Union Arne Hegefors Excel Programming 1 July 24th 06 04:22 PM
union/disunion? Arne Hegefors Excel Programming 1 July 24th 06 01:56 PM
Union only works for sometimes. Shu Excel Programming 3 December 14th 03 01:25 PM
Excel's range Union operator in WORKDAY function gives #VALUE!. Rod Morrell Excel Programming 0 October 9th 03 02:59 PM


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

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"