Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Using "Countif" in macro gives compile error
Hi to all,
I dont know why following line of code in my macro is giving a compile error Single line Code currency_check = Application.WorksheetFunction.COUNTIF(N:N,"<GBP") - Application.WorksheetFunction.COUNTIF(N:N,"<"&"*" ) <<<Single line Code I have declared it as Dim currency_check As Integer But the compiler objects at ":" (n:n) part of function and says that," Expected List Seperator or )" Kindly advice. With Regards, Ashish |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Using "Countif" in macro gives compile error
You have to pass a range to it, not an Excel cell reference
currency_check = Application.WorksheetFunction.COUNTIF(Range("N:N") ,"""<GBP""") - Application.WorksheetFunction.COUNTIF(Range("N:N") ,"""<*""") -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "ashish128" wrote in message ups.com... Hi to all, I dont know why following line of code in my macro is giving a compile error Single line Code currency_check = Application.WorksheetFunction.COUNTIF(N:N,"<GBP") - Application.WorksheetFunction.COUNTIF(N:N,"<"&"*" ) <<<Single line Code I have declared it as Dim currency_check As Integer But the compiler objects at ":" (n:n) part of function and says that," Expected List Seperator or )" Kindly advice. With Regards, Ashish |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Using "Countif" in macro gives compile error
Try this:-
currency_check = Application.WorksheetFunction.CountIf(Range("N:N") , "<GBP") - Application.WorksheetFunction.CountIf(Range("N:N") , "<" & "*") Mike "ashish128" wrote: Hi to all, I dont know why following line of code in my macro is giving a compile error Single line Code currency_check = Application.WorksheetFunction.COUNTIF(N:N,"<GBP") - Application.WorksheetFunction.COUNTIF(N:N,"<"&"*" ) <<<Single line Code I have declared it as Dim currency_check As Integer But the compiler objects at ":" (n:n) part of function and says that," Expected List Seperator or )" Kindly advice. With Regards, Ashish |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Using "Countif" in macro gives compile error
On Jun 15, 3:43 pm, "Bob Phillips" wrote:
You have to pass a range to it, not an Excel cell reference currency_check = Application.WorksheetFunction.COUNTIF(Range("N:N") ,"""<GBP""") - Application.WorksheetFunction.COUNTIF(Range("N:N") ,"""<*""") -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "ashish128" wrote in message ups.com... Hi to all, I dont know why following line of code in my macro is giving a compile error Single line Code currency_check = Application.WorksheetFunction.COUNTIF(N:N,"<GBP") - Application.WorksheetFunction.COUNTIF(N:N,"<"&"*" ) <<<Single line Code I have declared it as Dim currency_check As Integer But the compiler objects at ":" (n:n) part of function and says that," Expected List Seperator or )" Kindly advice. With Regards, Ashish- Hide quoted text - - Show quoted text - Thanks Friend, It worked |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Using "Countif" in macro gives compile error
On Jun 15, 3:51 pm, Mike H wrote:
Try this:- currency_check = Application.WorksheetFunction.CountIf(Range("N:N") , "<GBP") - Application.WorksheetFunction.CountIf(Range("N:N") , "<" & "*") Mike "ashish128" wrote: Hi to all, I dont know why following line of code in my macro is giving a compile error Single line Code currency_check = Application.WorksheetFunction.COUNTIF(N:N,"<GBP") - Application.WorksheetFunction.COUNTIF(N:N,"<"&"*" ) <<<Single line Code I have declared it as Dim currency_check As Integer But the compiler objects at ":" (n:n) part of function and says that," Expected List Seperator or )" Kindly advice. With Regards, Ashish- Hide quoted text - - Show quoted text - Thanks Friend, It worked |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Error "Unable to record" | Excel Worksheet Functions | |||
Shortcut key for "Paste Options" and "Error Checking" buttons? | Excel Discussion (Misc queries) | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
"Compile error: sub or function not defined" | Excel Discussion (Misc queries) | |||
Compile Error in Excel 2004 when Inputbox contains "VBCRLF" | Excel Discussion (Misc queries) |