Public Function WWWW(a As String, c As Integer)
'使用方法:wwww("猪肉:100 牛肉:100 鸡肉:100 羊肉:100",10)
Dim i As Integer
Dim b As Boolean
Dim s As String
For i = 1 To Len(a)
If Asc(Mid(a, i, 1)) > 47 And Asc(Mid(a, i, 1)) < 58 Then
b = True
Else
b = False
End If
If b Then
s = s & Mid(a, i, 1)
Else
s = s & "+"
End If
Public Function WWWW(a As String, c As Integer)
'使用方法:wwww("猪肉:100 牛肉:100 鸡肉:100 羊肉:100",10)
Dim i As Integer
Dim s As String
For i = 1 To Len(a)
If Asc(Mid(a, i, 1)) > 47 And Asc(Mid(a, i, 1)) < 58 Then
s = s & Mid(a, i, 1)
Else
s = s & "+"
End If
Next
WWWW = Eval(s) / c
End Function