Function getCount(ByVal str As String, countstr As String) As Integer
getCount = (Len(str) - Len(Replace(str, countstr, ""))) / Len(countstr)
End Function
function func(str1 as string,str2 as string) as long
dim i as long
func=0
for i=1 to len(str2)
if str1=mid(str2,i,1) then func=func+1
next
end function