Consulting

Results 1 to 6 of 6

Thread: Range Names: Good or Bad?

  1. #1
    VBAX Contributor Aaron Blood's Avatar
    Joined
    Sep 2004
    Location
    Palm Beach, Florida, USA
    Posts
    130
    Location

    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)

  2. #2
    VBAX Expert brettdj's Avatar
    Joined
    May 2004
    Location
    Melbourne
    Posts
    649
    Location
    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

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    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

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    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

  5. #5
    VBAX Contributor Aaron Blood's Avatar
    Joined
    Sep 2004
    Location
    Palm Beach, Florida, USA
    Posts
    130
    Location
    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.

  6. #6
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •