ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Storing a range variable in a cell (https://www.excelbanter.com/excel-discussion-misc-queries/193424-storing-range-variable-cell.html)

Dreaded404

Storing a range variable in a cell
 
I am writing a VBA script and I need to frequently load and store a range as
a long-term variable. How do I store an actual range as a variable so that I
can have a function load it and save it? I need to do this because I am
using the Application.OnTime function and will need to call a subroutine to
execute a complex series of actions.

Bob Phillips[_3_]

Storing a range variable in a cell
 
Just put someything like Sheet1!A1:M10 in the cell as use

Set myRange = Range(Worksheets("Sheet1").Range("A1").Value)

--
__________________________________
HTH

Bob

"Dreaded404" wrote in message
...
I am writing a VBA script and I need to frequently load and store a range
as
a long-term variable. How do I store an actual range as a variable so
that I
can have a function load it and save it? I need to do this because I am
using the Application.OnTime function and will need to call a subroutine
to
execute a complex series of actions.





All times are GMT +1. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com