Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default COUNTA function causing syntax error in macro...

A colleague is using XL2003 and has used the following formulae as part of a
macro - he's trying to test for non blank cells in a dynamic range:

ExtractLength=(COUNTA('Blank'!$A:$A)-1)

It's causing a Compile Error:Syntax Error

Is this because the formulae as written contains a circular reference? How
best to advise - any help gratefully accepted; macros really aren't my strong
point!

Amanda
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default COUNTA function causing syntax error in macro...

Try this version:

ExtractLength= Application.COUNTA(Sheets("Blank").Range("A:A"))-1


"Birmangirl" wrote:

A colleague is using XL2003 and has used the following formulae as part of a
macro - he's trying to test for non blank cells in a dynamic range:

ExtractLength=(COUNTA('Blank'!$A:$A)-1)

It's causing a Compile Error:Syntax Error

Is this because the formulae as written contains a circular reference? How
best to advise - any help gratefully accepted; macros really aren't my strong
point!

Amanda

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default COUNTA function causing syntax error in macro...

Try something like this:

ExtractLength=(WorksheetFunction.CountA(Range("'Bl ank'!$A:$A"))-1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Birmangirl" wrote:

A colleague is using XL2003 and has used the following formulae as part of a
macro - he's trying to test for non blank cells in a dynamic range:

ExtractLength=(COUNTA('Blank'!$A:$A)-1)

It's causing a Compile Error:Syntax Error

Is this because the formulae as written contains a circular reference? How
best to advise - any help gratefully accepted; macros really aren't my strong
point!

Amanda

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default COUNTA function causing syntax error in macro...

I am not sure what your colleage is trying to do
but try
exact length = application.worksheetfunction.counta(('Blank'!$A:$ A)-1
counta() is not a VB function

"Birmangirl" wrote:

A colleague is using XL2003 and has used the following formulae as part of a
macro - he's trying to test for non blank cells in a dynamic range:

ExtractLength=(COUNTA('Blank'!$A:$A)-1)

It's causing a Compile Error:Syntax Error

Is this because the formulae as written contains a circular reference? How
best to advise - any help gratefully accepted; macros really aren't my strong
point!

Amanda

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default COUNTA function causing syntax error in macro...

Cheers Ron (and everyone else who responded so quickly). Your answer solved
the problem.

Amanda

"Ron Coderre" wrote:

Try something like this:

ExtractLength=(WorksheetFunction.CountA(Range("'Bl ank'!$A:$A"))-1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Birmangirl" wrote:

A colleague is using XL2003 and has used the following formulae as part of a
macro - he's trying to test for non blank cells in a dynamic range:

ExtractLength=(COUNTA('Blank'!$A:$A)-1)

It's causing a Compile Error:Syntax Error

Is this because the formulae as written contains a circular reference? How
best to advise - any help gratefully accepted; macros really aren't my strong
point!

Amanda

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a Macro that enters a function that returns #VALUE! gevew Excel Discussion (Misc queries) 3 December 29th 06 08:34 PM
User Defined Function Causing Problems Steve Excel Discussion (Misc queries) 11 December 21st 06 12:18 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
My first macro - doesnt work - function not recognised James Cornthwaite Excel Worksheet Functions 2 May 14th 06 05:13 PM
Macro with Array Function Problems Brett Excel Worksheet Functions 5 January 10th 06 09:50 PM


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

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

About Us

"It's about Microsoft Excel"