Thread: Parallel ranges
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Unger Dave Unger is offline
external usenet poster
 
Posts: 153
Default Parallel ranges

Hi Jim,

Thanks for your reply - I suspected this was route I'd have to go -
one of these days I'll update to a later version.

regards,

Dave

On Mar 26, 2:36 pm, "Jim Rech" wrote:
Do you suppose this is a limitation of Excel 97?


Yes it is. You'd have to approach it like this:

Sub a()
Dim Rng1 As Range, Rng2 As Range
Dim Area As Range
Set Rng1 = Range("A1:A3,B10:B12")
MsgBox Rng1.Address

For Each Area In Rng1.Areas
If Rng2 Is Nothing Then
Set Rng2 = Area
Else
Set Rng2 = Union(Area, Area.Offset(, 5))
End If
Next
MsgBox Rng2.Address
End Sub

--
Jim"Dave Unger" wrote in message

oups.com...
| Hi Bernie,
|
| Thanks for your reply, but this is still a problem for me.
|
| Running your macro:
|
| Set Rng1 = Range("A1:A3,B10:B12")
| MsgBox Rng1.Address returns "$A$1:$A$3,$B$10:$B$12"
|
| and
|
| Set Rng2 = Rng1.Offset(, Col - 1)
| MsgBox Rng2.Address returns "$C$1:$C$3"
|
| Do you suppose this is a limitation of Excel 97?
|
| regards,
|
| Dave
|
|