FunctionCountstr(STR1,Str2) dimtmp,i,j Ifstr1 =“” Orisnull(str1) j = 0然後,Elseifstr2 =“” Orisnull(str2) J = 1別的tmp = split(str1,str2) j = 0 fori = 0toubound(TMP) iftmp(i)<>“” thenj = j+1下一個Endif countstr = j最終功能