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