View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John John is offline
external usenet poster
 
Posts: 2,069
Default Accessing a macro created named range

I am using the following code in a macro to set up a named range on a
worksheet for use by other macros. I create the named range with the
following code:

ThisWorkbook.Names.Add Name:="Table1", RefersTo:=NewSheetName & "!$B$9:$H$500"

The new named range appears fine in the Developer Name Manager list, but
does not appear in the Name Box drop down list and I code such as
i = Range("_PAI_Table_bbb").Rows.Count
that uses Table1 errors w/ a 1004 range of object _Global failed.

Somehow I'm either not creating the range properly and/or I'm not
referencing it correctly.

I appreciate your help, -John