Union

G

Guest

I try to make a union of two ranges but I cannot get it to work. I write the
code like this:

Set rngForbiddenSearchRange = Union(Range(searchRange1), Range(searchRange))

where I previously have defined:
Dim searchRange1 As Range
Set searchRange1 = Range(Cells(segment.Row, 1), Cells(segment.Row, 100))

and in another sub i have:

Dim searchRange As Range
Set searchRange = Range(Cells(secID.Row, 1), Cells(secID.Row, 100))

and I pass the searchRange along to the sub where I try to do the union.

Please I cannot see what is wrong here! I really would appreciate any help!
thanks alot!
 

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

Top