View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
John[_19_] John[_19_] is offline
external usenet poster
 
Posts: 87
Default How hold multiple versions of the same range?

Nope... that doesn't work. I wasn't clear. I want to save
(Cells(1,1),cells(70,70)). Then I won't to work with those ceslls and if
the work process doesn't work I want to restore those cells back to the
beginning. It is like having a backup of the cells to restore.

If have set Myrange = range(cells(1,1),cells(1,70)) then whatever
happens in those cells happens in Myrange so it can't be used as a
backup. that's my problem.

I suppose I could just use sheet2 for backup but it seems an expensive
way rather than in an array.

John


Joel wrote:
Uh!
set Myrange = Range(Cells(1,1),cells(70,70))

You decaration actually put data into the array MyRange, my method just sets
a point to the range.


Dim MyRange(6) as range
set Myrange(0) = Range(Cells(1,1),cells(70,70))
set Myrange(1) = Range(Cells(71,1),cells(140,70))
set Myrange(2) = Range(Cells(141,1),cells(210,70))
set Myrange(3) = Range(Cells(211,1),cells(280,70))
set Myrange(4) = Range(Cells(281,1),cells(350,70))
set Myrange(5) = Range(Cells(351,1),cells(420,70))

Myrange(5).copy destination:=sheets("Sheet2").Range("A1")



"John" wrote:

I want to save multiple possibilities for a range and be able to pop one
back into the range. Is there a way to do this other than saving the
ranges to an array? Can't use copy, paste because there are more than one.

Have Myrange = (Cells(1,1),cells(70,70))

then have 6 different versions of myrange.

thanks
John