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

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!

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

try:

Set rngForbiddenSearchRange = Union(searchRange1,SearchRange)


"Arne Hegefors" wrote in message
...
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!



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
Union Method Noah Excel Programming 2 February 3rd 06 02:36 PM
union problem tom taol Excel Programming 2 February 1st 05 08:43 AM
Union question ToddG Excel Programming 3 June 25th 04 07:57 PM
Union only works for sometimes. Shu Excel Programming 3 December 14th 03 01:25 PM
Trouble with Union Ed Excel Programming 2 December 4th 03 07:30 PM


All times are GMT +1. The time now is 01:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"