Getting the entry of a Named Range
I have a Named Range called VERSION, in which I update every time I make a
new version of the workbook. In my macro, I want to grab this value. ThisWorkbook.Names("VERSION").Value returns "=UPDATES!$D$16". How should I change that line to return the value which is Cell D16 on my UPDATES tab? -- TIA, Brad E. |
Getting the entry of a Named Range
Brad,
To get the value use MyVar = ThisWorkbook.Names("Version").RefersToRange -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Brad E." wrote: I have a Named Range called VERSION, in which I update every time I make a new version of the workbook. In my macro, I want to grab this value. ThisWorkbook.Names("VERSION").Value returns "=UPDATES!$D$16". How should I change that line to return the value which is Cell D16 on my UPDATES tab? -- TIA, Brad E. |
Getting the entry of a Named Range
ThisWorkbook.Names("VERSION").RefersToRange
"Brad E." wrote: I have a Named Range called VERSION, in which I update every time I make a new version of the workbook. In my macro, I want to grab this value. ThisWorkbook.Names("VERSION").Value returns "=UPDATES!$D$16". How should I change that line to return the value which is Cell D16 on my UPDATES tab? -- TIA, Brad E. |
Getting the entry of a Named Range
Hi Brad
try evaluate(thisworkbook.names("VERSION").value) -- Regards Roger Govier Brad E. wrote: I have a Named Range called VERSION, in which I update every time I make a new version of the workbook. In my macro, I want to grab this value. ThisWorkbook.Names("VERSION").Value returns "=UPDATES!$D$16". How should I change that line to return the value which is Cell D16 on my UPDATES tab? |
Getting the entry of a Named Range
Thanks, Roger. I like this better than the "RefersToRange" method. Evaluate
makes sense to me. Brad "Roger Govier" wrote: Hi Brad try evaluate(thisworkbook.names("VERSION").value) -- Regards Roger Govier Brad E. wrote: I have a Named Range called VERSION, in which I update every time I make a new version of the workbook. In my macro, I want to grab this value. ThisWorkbook.Names("VERSION").Value returns "=UPDATES!$D$16". How should I change that line to return the value which is Cell D16 on my UPDATES tab? . |
All times are GMT +1. The time now is 09:45 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com