Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default How hold multiple versions of the same range?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How hold multiple versions of the same range?

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default How hold multiple versions of the same range?

Thanks. I didn't know how to do that .copy destination thing. I was
saving in sdt myranr(2) = then didn't know how to get it back on the
worksheet.

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How hold multiple versions of the same range?

there are lots of trade-off you make when programming. The trade offs
include memory as well as time to execute. It is ineffiecient to move data
into an array and then not use the array data. Memory is cheap these days
and storing data in the spreadsheet is better than to move data into an array
which uses execution time.

"John" wrote:

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


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
hold shift key down to select multiple cells dean Excel Discussion (Misc queries) 1 September 19th 08 06:10 PM
Multiple Versions of the same file Dave Peterson Excel Programming 2 January 3rd 07 06:48 PM
Can one cell hold multiple check boxes (and then sort based off e. OT Excel Discussion (Misc queries) 1 March 29th 06 07:32 PM
Multiple Versions Andrew Excel Discussion (Misc queries) 3 January 1st 05 04:38 AM
Multiple Userform Hold Data to edit bg18461[_8_] Excel Programming 2 June 4th 04 03:10 AM


All times are GMT +1. The time now is 10:50 AM.

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"