A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Named Reference



 
 
Thread Tools Display Modes
  #1  
Old December 17th, 2005, 02:09 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Named Reference

Hi,

Can someone tell me what the pros and cons are (if any) of these 2 ways
of naming a range.

ActiveWorkbook.Names.Add NAME:="HOME", RefersTo:=ActiveCell
Range("HOME").Select

or

Dim HOME As Range
Set HOME = ActiveCell
HOME.Select

Thanks,

DaveU

  #2  
Old December 17th, 2005, 04:33 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Named Reference

It seems to me that the first method creates a named range that is
essentially meaningless to the user and is only used for VBA processing.
Additionally, if you don't write code to delete the named range it will just
sit there in the workbook waiting for somebody to ask what it means.

The second alternative is a cleaner way to declare the range variable
without having it intrude upon the user-facing part of the workbook.

Just my opinion....Your mileage may vary.

***********
Regards,
Ron

XL2002, WinXP-Pro


"Dave" wrote:

Hi,

Can someone tell me what the pros and cons are (if any) of these 2 ways
of naming a range.

ActiveWorkbook.Names.Add NAME:="HOME", RefersTo:=ActiveCell
Range("HOME").Select

or

Dim HOME As Range
Set HOME = ActiveCell
HOME.Select

Thanks,

DaveU


  #3  
Old December 17th, 2005, 08:20 AM posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Named Reference

Ron, that's a good explanation. I did have a vague idea that the 2nd
way was better (the code seemed "neater") but couldn't quite say why it
was so.

Thanks a lot

DaveU

 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
footnote reference font Jan Byrd Page Layout 1 September 7th, 2005 09:00 PM
COUNT /COUNTIF for Multiple Column Defined Dynamic Named Range Tinä General Discussion 1 October 26th, 2004 01:36 AM
Named range row/column reference Urklnme General Discussion 1 September 21st, 2004 07:13 PM
Circular reference error Linda New Users 3 April 27th, 2004 04:09 AM
create array of values returned by named formulas Rob Hick Charts and Charting 4 September 27th, 2003 04:53 AM


All times are GMT +1. The time now is 08:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.