Check a range to see if a value exists in it
Hi Howard,
I think there are two small changes. First, be sure to set "lData" = your data range. If it is a named range use:
Set lData = Sheet1.Range("ldata")
If it is not named, use:
Set lData = Sheet1.Range("G1:G10")
Then, change your function in the lCnt line to CountIf and drop the quotes:
lCnt = Application.WorksheetFunction.CountIf(lData, i)
Hope this helps
Ben
|