naming ranges
Activesheet.Names.Add Name:="List1", _
Refersto:="=" & Activesheet.Name & "!$A$1:$A$10"
Adds a sheet level name.
This does so as well:
Selection.Resize(10,1).Name = "Sheet2!List2"
--
Regards,
Tom Ogilvy
"Alexander Bogomolny" wrote in message
...
Hello:
Is it possible to define range names local to a worksheet. In other
words, is it possible to have a range name that in different worksheets
refers to different ranges.
When done manually, it seems this is how Excel works. But when I created
a macro, there were no indication that a name is associated with a
particular worksheet. I.e., it does refer to a particular worksheet, but
when used in other worksheets gives exactly same value.
Say, I have worksheets Sheet1 and Sheet2. I'd like a variable w refer to
Sheet1!$A$1, if used in Sheet1, and to Sheet2!$B$1, if used in Sheet2.
Is this possible?
Thank you,
Alex
|