Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Named Range
How can I address via vb the value stored in a named range cell.
example: on worksheet 3 I have a cell named variable 1 I want to retrive the value from that cell without going to it and selecting it. Is there a way? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Named Range
If Range(Variable_1) = "Blah" 'Spaces not allowed in named ranges
or If [Variable_1] = "Blah" HTH Charles Sandy wrote: How can I address via vb the value stored in a named range cell. example: on worksheet 3 I have a cell named variable 1 I want to retrive the value from that cell without going to it and selecting it. Is there a way? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Named Range
Either
val = Worksheets("worksheet 3").Range("rangename").Value or val = Names("rangename").RefersToRange.Value should work. This assumes Worksheet 3 is in the active workbook. If not then you need to qualify the above by, for examnple, val = Workbooks("Workbook1").Names("rangename").RefersTo Range.Value Sandy wrote: How can I address via vb the value stored in a named range cell. example: on worksheet 3 I have a cell named variable 1 I want to retrive the value from that cell without going to it and selecting it. Is there a way? Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Named Range
Depends on rather the range name is workbook level or worksheet level
Workbook level syntax: Workbooks("Book1.xls").Worksheets("Sheet1").Range( "RangeName") Worksheet level syntax: Workbooks("Book1.xls").Worksheets("Sheet1").Range( "Sheet1!RangeName") Or when the worksheet's name has at least 1 space in it and it's a worksheet level range name. Workbooks("Book1.xls").Worksheets("Sheet 1").Range("'Sheet 1'!RangeName") -- Ronald R. Dodge, Jr. Production Statistician/Programmer Master MOUS 2000 "Sandy" wrote in message ... How can I address via vb the value stored in a named range cell. example: on worksheet 3 I have a cell named variable 1 I want to retrive the value from that cell without going to it and selecting it. Is there a way? Thanks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Named Range
good point, I forgot my quotes...
Range("Variable_1") Charles Andrew Taylor wrote: Either val = Worksheets("worksheet 3").Range("rangename").Value or val = Names("rangename").RefersToRange.Value should work. This assumes Worksheet 3 is in the active workbook. If not then you need to qualify the above by, for examnple, val = Workbooks("Workbook1").Names("rangename").RefersTo Range.Value Sandy wrote: How can I address via vb the value stored in a named range cell. example: on worksheet 3 I have a cell named variable 1 I want to retrive the value from that cell without going to it and selecting it. Is there a way? Thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Named Range
Sandy wrote:
How can I address via vb the value stored in a named range cell. example: on worksheet 3 I have a cell named variable 1 No you don't; that's not a valid range name. If the range name of the cell were variable1 (without the space) you can access it with Range("variable1").value Alan Beban I want to retrive the value from that cell without going to it and selecting it. Is there a way? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using named Excel range in VBA | Excel Discussion (Misc queries) | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
If any cell in named range = 8 then shade named range | Excel Programming | |||
Paste a named range to another range in Excel | Excel Discussion (Misc queries) | |||
Excel Named Range Question | Excel Programming |