Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA union of two ranges

I'm trying to define a range, consisting of two separate ranges on two
different worksheets within the same workbook. From the help section of
Excel 2000, I got the following sample, but when the ranges are on separate
sheets, I get an error. Is there some way of accomplishing this?


Sub MultipleRange()
Dim r1, r2, myMultipleRange As Range
Set r1 = Sheets("Sheet1").Range("A1:B2")
Set r2 = Sheets("Sheet2").Range("C3:D4") <== I changed the sample to
show a different sheet
Set myMultipleRange = Union(r1, r2)

For Each c In Range("myMultipleRange")
If (Not IsEmpty(c)) And (Not c.Value = "SYMBOL") Then _
QuoteStr = QuoteStr & "+" & c.Value
Next
End Sub

Thanks for any guidance,

Dick Sanders


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
Quick question on naming a union of ranges [email protected] Excel Discussion (Misc queries) 2 July 29th 07 11:15 AM
union range Curt Excel Discussion (Misc queries) 9 April 20th 07 02:32 PM
printing Union of Ranges anny Excel Worksheet Functions 2 January 26th 06 10:22 AM
UNION of Arrays - is possible? Marina Limeira Excel Discussion (Misc queries) 1 January 22nd 06 12:38 PM
Help w/ Union Queries Jenn Excel Discussion (Misc queries) 1 January 12th 05 01:07 AM


All times are GMT +1. The time now is 08:27 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"