View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_105_] dominicb[_105_] is offline
external usenet poster
 
Posts: 1
Default Help with Simple Function


Good afternoon Tomski

The problem is in your End If line. Take it out and your function wil
work fine.

You function could phrase your If statement like this:

If x = Str Then
temp = temp + 1
End If

or like this:

If x = Str Then temp = temp + 1

but not a combination of the two.

Or you could use the =COUNTIF() function to get the job done

HTH

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=40075