ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving Range Locatoin into a Variable (https://www.excelbanter.com/excel-programming/276674-re-saving-range-locatoin-into-variable.html)

Bob Phillips[_5_]

Saving Range Locatoin into a Variable
 
Dale,

The address is just a property of the range

= Range(sDelivery_Rng).Address

But, this is a string, not an object, so just use

Const sDelivery_Rng = "Q215"
Dim oSave_Del_Rng As String

oSave_Del_Rng = Range(sDelivery_Rng).Address

or just

Const sDelivery_Rng = "Q215"
Dim oSave_Del_Rng As Range

Set oSave_Del_Rng = Range(sDelivery_Rng)
MsgBox oSave_Del_Rng.Address



--

HTH

Bob Phillips

"Dale Cox" wrote in message
...
The following code executes just fine. The value moved
into oSave_Del_Rng, however, is the value in the Cell
Q215. I need the cell address, not the value of the cell,
moved into the variable.
Const sDelivery_Rng = "Q215"
Dim oSave_Del_Rng as Range
Set oSave_Del_Rng = Range(sDelivery_Rng)

Help!





All times are GMT +1. The time now is 01:16 PM.

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