View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 536
Default Name the range AFTER copied to new sheet

On Tuesday, February 26, 2013 1:34:12 PM UTC-8, GS wrote:
And so you have a perfect example of why you should never use global

scope with defined names unless it's *absolutely necessary*! If you

want names to be reusable on more than 1 sheet then they *must* be

defined with local scope as follows...



'Sheetname'!DefinedName



..where the sheetname is wrapped in apostrophes, and delimited from the

defined name by the exclamation character. Doing this will allow you to

reuse the name on as many sheets as desired. Note that the RefersTo

does not, however, need to be the same address on every sheet using the

name.



HTH



--

Garry



Free usenet access at http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


Thanks Garry for taking a look.

You offer some powerful information if I could get my head around it. I'm afraid I am out of the fry pan into the fire.

If I take this 'Sheetname'!DefinedName and do this 'Sessions'!sname it does not compile, at least as it sits by itself, sname should be SName right?

Frankly, I'm at a loss as to how to incorporate 'Sheetname'!DefinedName into my range naming code line.

Howard