Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Naming non-contigent cells with vba

Ben McClave explained :
Garry,

I suppose you could do it either way, depending on the need. I understood
from Howard's original question that this was to help with another poster's
question. That post needed to name a range of cells on Sheet1 for use on
Sheet2. By making the named ranges Global, I intended for the name reference
to always refer to the cells on Sheet1, regardless of what sheet uses the
reference.

Ben


Ben
I understand your point.

Food for thought...
I try to follow the so called 'best practice' of never using global
names unless absolutely necessary. For me, global names aren't reusable
on other sheets. Local names are reusable on other sheets and can be
referenced simply by prefixing the defined name with the sheet name...

'Sheet2'!Data1 = 'Sheet1'!Data1

...where both ref the same data area on both sheets.
===

Optionally, you could go as did Howard and name the Sheet2 data area
"Data2" but that's a dis-association IMO...

'Sheet2'!Data2 = 'Sheet1'!Data1
===

Finally, should Sheet2 need to be copied to another wkb the global
names follow with their refs to the original wkb. This can/will raise
name conflict issues if the target wkb happens to use the same names.
If so, the user is prompted as to how to proceed (choose which version
of the name to use), and depending on how the prompt is replied to all
hell can break loose. Since local scope names are confined to the wks
they're defined on, no name conflict issues are raised when copying
sheets to another wkb. For example, what do you suppose would happen in
the case of global scope names used on a template that gets inserted
into any wkb the user chooses?.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Range naming cells with blank cells through coding Naveen J V Excel Discussion (Misc queries) 1 March 27th 08 01:46 PM
Naming Cells - need help Brad Excel Programming 1 December 18th 07 06:40 PM
naming cells Dave Excel Discussion (Misc queries) 2 September 6th 06 09:00 PM
Naming cells... Steve Excel Worksheet Functions 6 January 3rd 06 07:40 PM
Naming Cells tjtjjtjt[_2_] Excel Programming 2 February 7th 04 06:53 PM


All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"