ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Another Question regarding ranges (https://www.excelbanter.com/excel-programming/358847-another-question-regarding-ranges.html)

[email protected]

Another Question regarding ranges
 
How do you go about holding a range in memory? Where you can recall
that data to be used elsewhere. I have a couple of instantances where
it would be far easier for me to do that...

Thanks,

Hans


Tom Ogilvy

Another Question regarding ranges
 
at the top of a module

Public v as Variant

then somewhere in your code

v = Activesheet.Range("A1:B30")


then somewhere else in your code (somewhere after the above line)

msgbox " the value of the 3rd row of the 2nd " & _
"column of the range is " & v(3,2)

--
Regards,
Tom Ogilvy


" wrote:

How do you go about holding a range in memory? Where you can recall
that data to be used elsewhere. I have a couple of instantances where
it would be far easier for me to do that...

Thanks,

Hans



Patricia Shannon

Another Question regarding ranges
 
If you terminate your pgm other than running thru the "end sub", use "exit
sub" rather than "end". End resets all variables. I learned about this the
hard way.

"Tom Ogilvy" wrote:

at the top of a module

Public v as Variant

then somewhere in your code

v = Activesheet.Range("A1:B30")


then somewhere else in your code (somewhere after the above line)

msgbox " the value of the 3rd row of the 2nd " & _
"column of the range is " & v(3,2)

--
Regards,
Tom Ogilvy


" wrote:

How do you go about holding a range in memory? Where you can recall
that data to be used elsewhere. I have a couple of instantances where
it would be far easier for me to do that...

Thanks,

Hans



Tom Ogilvy

Another Question regarding ranges
 
End alone does that, but not End Sub. different commands.

--
Regards,
Tom Ogilvy


"Patricia Shannon" wrote in
message ...
If you terminate your pgm other than running thru the "end sub", use "exit
sub" rather than "end". End resets all variables. I learned about this

the
hard way.

"Tom Ogilvy" wrote:

at the top of a module

Public v as Variant

then somewhere in your code

v = Activesheet.Range("A1:B30")


then somewhere else in your code (somewhere after the above line)

msgbox " the value of the 3rd row of the 2nd " & _
"column of the range is " & v(3,2)

--
Regards,
Tom Ogilvy


" wrote:

How do you go about holding a range in memory? Where you can recall
that data to be used elsewhere. I have a couple of instantances where
it would be far easier for me to do that...

Thanks,

Hans





Patricia Shannon

Another Question regarding ranges
 
Right, that's what I thought I said.

"Tom Ogilvy" wrote:

End alone does that, but not End Sub. different commands.

--
Regards,
Tom Ogilvy


"Patricia Shannon" wrote in
message ...
If you terminate your pgm other than running thru the "end sub", use "exit
sub" rather than "end". End resets all variables. I learned about this

the
hard way.

"Tom Ogilvy" wrote:

at the top of a module

Public v as Variant

then somewhere in your code

v = Activesheet.Range("A1:B30")


then somewhere else in your code (somewhere after the above line)

msgbox " the value of the 3rd row of the 2nd " & _
"column of the range is " & v(3,2)

--
Regards,
Tom Ogilvy


" wrote:

How do you go about holding a range in memory? Where you can recall
that data to be used elsewhere. I have a couple of instantances where
it would be far easier for me to do that...

Thanks,

Hans






Patricia Shannon

Another Question regarding ranges
 
Actually, I'm glad you added your remark, because it is probably more clear
to others than the way I worded it.

"Tom Ogilvy" wrote:

End alone does that, but not End Sub. different commands.

--
Regards,
Tom Ogilvy


"Patricia Shannon" wrote in
message ...
If you terminate your pgm other than running thru the "end sub", use "exit
sub" rather than "end". End resets all variables. I learned about this

the
hard way.

"Tom Ogilvy" wrote:

at the top of a module

Public v as Variant

then somewhere in your code

v = Activesheet.Range("A1:B30")


then somewhere else in your code (somewhere after the above line)

msgbox " the value of the 3rd row of the 2nd " & _
"column of the range is " & v(3,2)

--
Regards,
Tom Ogilvy


" wrote:

How do you go about holding a range in memory? Where you can recall
that data to be used elsewhere. I have a couple of instantances where
it would be far easier for me to do that...

Thanks,

Hans







All times are GMT +1. The time now is 11:53 AM.

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