Hello,
I'm trying to use a calculated Named Range in VBA and I found myself in the position that I cannot do that directly. What am I talking about? In the example given in the picture bellow, the "s" Named Range is calculated using the values from the "a" and "b" Named Ranges. You can then use "s" in excel as you would do with any other Named Range and it works perfectly fine. The same is not true for VBA, as it's not pointing to an actual range in the workbook. So, what would normally work, such as:
It doesn't. I would expect that
to return the value of the Named Range, but it just returns the "Refers To" from the picture bellow. Is this a bug?
Is there a way to use directly in VBA the Named Range "s"? And yes, I do realize that inputting the value into a cell would solve the issue, but it's not an elegant solution.
Thank you.
I'm trying to use a calculated Named Range in VBA and I found myself in the position that I cannot do that directly. What am I talking about? In the example given in the picture bellow, the "s" Named Range is calculated using the values from the "a" and "b" Named Ranges. You can then use "s" in excel as you would do with any other Named Range and it works perfectly fine. The same is not true for VBA, as it's not pointing to an actual range in the workbook. So, what would normally work, such as:
VBA Code:
Range("a")
ActiveWorkbook.Names("a").RefersToRange
Code:
ActiveWorkbook.Names("S").Value
Is there a way to use directly in VBA the Named Range "s"? And yes, I do realize that inputting the value into a cell would solve the issue, but it's not an elegant solution.
Thank you.