View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tushar Mehta Tushar Mehta is offline
external usenet poster
 
Posts: 1,071
Default Creating a local and hidden name; Parameters

In article ,
says...
Kevin,

You are creating different types of Names. By using the worksheet name in
the Names name (if you see what I mean ;-)). you are creating a worksheet
name. By not using it, you are creating workbook names. In most cases, the


No, not quite. The following creates one worksheet name and one
workbook name.

Sub createNames()
ActiveWorkbook.Names.Add "aName", RefersTo:="3"
ActiveSheet.Names.Add "aName", RefersTo:="2"
End Sub

However, due to the vagaries of how the Add method works for the Names
collection, the following creates and modifies a *worksheet* name.

Sub createNames()
ActiveSheet.Names.Add "aName", RefersTo:="2"
ActiveWorkbook.Names.Add "aName", RefersTo:="3"
End Sub

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Kevin,

You are creating different types of Names. By using the worksheet name in
the Names name (if you see what I mean ;-)). you are creating a worksheet
name. By not using it, you are creating workbook names. In most cases, the
latter is all that is required, but there are instances where the former is
useful.

You might find it useful to read this
http://www.xldynamic.com/source/xld.Names.html