Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Names.Add - compile error
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 ! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Names.Add - compile error
try this.
Sub makename() ma = ActiveCell.Address ActiveWorkbook.Names.Add Name:="base", RefersTo:= _ "=OFFSET(" & ma & ",COUNTA($a$2:$a$6000),6)" End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Eric @ BP-EVV" wrote in message ... 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 ! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
VBAProject name compile error, not defined at compile time | Excel Programming | |||
error message: compile error, argument not optional | Excel Programming | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) |