Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
What's the vba code equivalent for Countif
I tried using the foloowing code
Onlap = CountIf(Worksheets("A Grade").Range("I5:I104"), L) and it says that countif is an undefined sub or function. What is the correct VB code in 2003 to count the number of times a number occurs in a range. Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
What's the vba code equivalent for Countif
Use WorksheetFunction object:
Onlap = WorksheetFunction.CountIf(Worksheets("A Grade").Range("I5:I104"), L) - Chirag Shortcut Manager - Assign keyboard shortcuts to menu items and macros http://officeone.mvps.org/xlsctmgr/xlsctmgr.html "NDBC" wrote in message ... I tried using the foloowing code Onlap = CountIf(Worksheets("A Grade").Range("I5:I104"), L) and it says that countif is an undefined sub or function. What is the correct VB code in 2003 to count the number of times a number occurs in a range. Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
What's the vba code equivalent for Countif
Hi,
Simply tell the VB compiler it's a worksheetfunction Onlap = WorksheetFunction.CountIf(Worksheets("A Grade").Range("I5:I104"), L) Mike "NDBC" wrote: I tried using the foloowing code Onlap = CountIf(Worksheets("A Grade").Range("I5:I104"), L) and it says that countif is an undefined sub or function. What is the correct VB code in 2003 to count the number of times a number occurs in a range. Thanks |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
What's the vba code equivalent for Countif
Not sure if it's exactly the same as your suggetions but it worked. I googled
whilst I was waiting for a response. Onlap = Application.CountIf(Worksheets("A Grade").Range("I5:I104"), L) "NDBC" wrote: I tried using the foloowing code Onlap = CountIf(Worksheets("A Grade").Range("I5:I104"), L) and it says that countif is an undefined sub or function. What is the correct VB code in 2003 to count the number of times a number occurs in a range. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to do a countif - want cells that are before or on a certain dateand do not want to hard code that date | Excel Worksheet Functions | |||
Mutiple COUNTIF or equivalent. | Excel Worksheet Functions | |||
Creating the equivalent of a "hash code" for a workbook | Excel Discussion (Misc queries) | |||
COUNTIF TO BUILD SIMPLE CODE | Excel Worksheet Functions | |||
What is the Access equivalent of Excel's COUNTIF? | Excel Discussion (Misc queries) |