作者: Benjamin_luk 时间: 2004-8-19 22:10
自己建立一个FUNCTION了,没有现成的[em05]作者: stanleypan 时间: 2004-8-20 02:54
Public Function AppearTimes(ByVal OriginStr As String, ByVal SubStr As String) As Long
'一个子字符串在母字符串出现的次数
Dim n As Long, i As Long
Dim FrontStr As String, BackStr As String
i = 0
Do
n = InStr(OriginStr, SubStr)
If n <= 0 Then
Exit Do
End If
i = i + 1
OriginStr = Right(OriginStr, Len(OriginStr) - n + 1 - Len(SubStr))
Loop
AppearTimes = i
End Function作者: 丸宏振引 时间: 2004-8-20 05:37
n = UBound(Split(Range("a1").Value, "?"))作者: 老鬼 时间: 2004-8-29 06:15
=len(A1)-len(substitute(A1,"?",""))