View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alex Simmons Alex Simmons is offline
external usenet poster
 
Posts: 15
Default Names.Add - compile error

On Apr 17, 2:12*pm, Eric @ BP-EVV
wrote:
Can anyone tell me what's wrong with the following statement that is
preventing my VBA code from compiling ?

Names.Add(Name:="Base",
RefersTo:=ActiveCell.Offset(WorksheetFunction.Coun tA("$a$2:$a$60000"),6 as
range)

Thank !


You shouldn't need the "As Range". This worked for me:

Names.Add "Base", ActiveCell.Offset(WorksheetFunction.CountA("$A$2:$ A
$60000"),6)

Alex