Are you fluent with .Names.Add using values rather than addresses? If so can you please follow this very short sequence and answer one question?[vba]sub foo()
dim i as integer
i=10
ThisWorkbook.Names.Add "OddRange", i
end sub[/vba]This creates a "defined name range" named OddRange and it looks like this in Excel (for XL03 go alt-i-n-d; for 2007+ you're on your own):
=10
Now: how can I read that range in VBA? Anything in code saying
range("OddRange")
fails. If you shift-F9 it you get
<Method 'Range' of object '_Global' failed>.
I find no way to access the range or its contents. Try it. Can you solve? What line of code would produce the value 10 from that range?
I'm sorry to be a d____e but lately I've posted hard questions (on other boards, of course) and even real smart members get frustrated because they can't solve it or lack expertise in some aspect of the question, so they either reply with something absolutely irrelevant or lecture about their displeasure with me trying to do what I'm trying to do. This is a hard question, and if you're frustrated that you can't really speak to it, you don't need to diminish the thread with distracting noise such as "you can create the range without VBA" or "Why don't you just use 10 instead of a range set to 10?" I hate having to say this, but lately it seems I needed to say this 100 times. Obviously if you don't have the solution, but want to say something relevant to the actual question or ask for more info or post anything that will indeed help lead to the actual answer, of course that's great. Absolutely. I'm really not a total d____e, but I've been running into a slew of them on my questions lately! No offense to those who deserve none.