VBA Express Forum  
Google
 




Go Back   VBA Express Forum > VBA Code & Other Help > Excel Help
     Feedback     
Register FAQ Members Arcade KBase Articles

Reply
 
Thread Tools Display Modes
Old 05-04-2005, 10:28 PM   #1
Aaron Blood
 
Aaron Blood's Avatar

 
Joined: Sep 2004
Posts: 130
Kb Entries: 0
Articles: 0
Range Names: Good or Bad?

Curious to hear your thoughts on range names.

1. Do you think defined range names in spreadsheets are good or bad?

2. Would you recommend defined range names as a modelling best practice?


Forgive the cross posting to: MrExcel, OzGrid, Vbax
(some of you just don't respond on the other boards and I don't want to miss the opinions of certain folks I respect on each)

Local Time: 11:00 PM
Local Date: 09-02-2010
Location:

 
Reply With Quote Top
Old 05-04-2005, 11:10 PM   #2
brettdj
 
brettdj's Avatar
Knowledge Base Approver

 
Joined: May 2004
Posts: 647
Kb Entries: 22
Articles: 0
This may be better off as a poll, http://www.vbaexpress.com/forum/showthread.php?t=3083

1) Bad

- too often people attach data to the top or bottom of a range name and it doesn't get picked up.
- People seem to like creating range names and then use OFFSET to reference cells from that range. Not pretty from an auditing viewpoint. An Index/Match combination is better

2) No

follows (1)

Cheers

Dave

Local Time: 02:00 PM
Local Date: 09-03-2010
Location:

 
Reply With Quote Top
Old 05-05-2005, 12:14 AM   #3
Paleo
 
Paleo's Avatar
Administrator
VP-Knowledge Base

 
Joined: Jan 2005
Posts: 1,198
Kb Entries: 8
Articles: 1
1) Depends on the issue to be solved
2) Same as one



Best Regards,

Carlos Paleo.

To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

If Debugging is harder than writing a program and your code is as good as you can possibly make
it, then by definition you're not smart enough to debug it.




http://www.mugrs.org

Local Time: 02:00 AM
Local Date: 09-03-2010
Location:

 
Reply With Quote Top
Old 05-05-2005, 05:22 AM   #4
xld
 
xld's Avatar
Distinguished Lord of VBAX

 
Joined: Apr 2005
Posts: 18,253
Kb Entries: 3
Articles: 0
Aaron,

Surprised to hear you asking this, I thought you would already have had your opinion . As an aside, love your watermark solution.

Anyways ....

Range names are not good, they are excellent, absolutely no doubt about it in my mind. They
a) make the spreadsheet more maintainable in that if a range changes, you only have to make that change in one place
b) they make the formulas easier to read. For instance
=IF(ISNA(myValue),"",myValue)
is immeasurably better than
=IF(ISNA(VLOOKUP(A1,$H$1:$M$100,2,FALSE)),"",VLOOKUP(A1,$H$1:$M$100,2,FALSE ))
and that is a very trivial example of the power of range names
c) they can be used to protect formulas from change by unwitting users
d ) with worksheet names you can have the same name applying to different ranes on individual sheets
e) some solutions can only be achieved with range names.

The example given by brettdj is bad programming, not a fault of range names. If the range is dynamic, create a dynamic range name.

Also, range names can be used to setup constants in your worksheets. For example, I have a range name of VAT, with a RefersTo value of 17.5%, which means I can use formulae such as
=A1*VAT
much more descriptive, maintainable, and flexible.

There is a very good paper on range names at http://www.xldynamic.com/source/xld.Names.html



Nihil simul inventum est et perfectum

Abusus non tollit usum

Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber

Local Time: 05:00 AM
Local Date: 09-03-2010
Location:

 
Reply With Quote Top
Old 05-05-2005, 08:48 AM   #5
Aaron Blood
 
Aaron Blood's Avatar

 
Joined: Sep 2004
Posts: 130
Kb Entries: 0
Articles: 0
Quote:
 
Originally Posted by: xld
Aaron,

Surprised to hear you asking this, I thought you would already have had your opinion . As an aside, love your watermark solution.



Actually, yes I do have a very strong opinion on the subject. But, in this case, my opinion is not important. I want to hear the thoughts of others.

Local Time: 11:00 PM
Local Date: 09-02-2010
Location:

 
Reply With Quote Top
Old 05-05-2005, 04:18 PM   #6
Zack Barresse
 
Zack Barresse's Avatar
Site Admin
Urban Myth

 
Joined: May 2004
Posts: 4,463
Kb Entries: 41
Articles: 0
I voted No in the Poll by Dave. My two opinions? ...

Named Ranges ..
.. can go well in certain formulas, when/if used correctly.
.. do not belong on the VBA field.


Comments can be added if desired.

Local Time: 09:00 PM
Local Date: 09-02-2010
Location:

 
Reply With Quote Top
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Fridges | Skype | Ipod Shuffle | House Insurance | Debt Help


All times are GMT -4. The time now is 12:00 AM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright @2004 - 2009 VBA Express