Union Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top