|
我编辑的最新电子表格版工程量计算书,大家快下载看看.
有以下功能值得大家注意:
1、计算式中输入公式,结果栏直接得出结果。
2、公式中可以输入中文等注释,不影响计算结果。
3、备注栏,有选择列表,通过下拉式选择是对还是错。
*不能计算小数的情况已经更改了。见附件。
计算结果中的FLW2函数代码见下:
--------------------------------------
Function FLW2(X As Range, Y As Integer)
If Y = 1 Then
For I = 1 To Len(X)
If Val(Mid(X, i, 1)) > 0 Or Mid(X, i, 1) = "(" Or Mid(X, i, 1) = "(" Or Mid(X, i, 1) = ")" Or Mid(X, i, 1) = ")" Or Mid(X, i, 1) = "." Or Mid(X, i, 1) = "0" Or Mid(X, i, 1) = "+" Or Mid(X, i, 1) = "-" Or Mid(X, i, 1) = "*" Or Mid(X, i, 1) = "/" Or Mid(X, i, 1) = "^" Or Mid(X, i, 1) = "mod" Then
Q = Q & Mid(X, i, 1)
End If
FLW2 = Application.Evaluate(Q)
Next I
ElseIf Y = 2 Then
For M = 1 To Len(X)
A = Application.WorksheetFunction.Substitute(X.Value, 0, "")
B = Application.WorksheetFunction.Substitute(A, 1, "")
C = Application.WorksheetFunction.Substitute(B, 2, "")
D = Application.WorksheetFunction.Substitute(C, 3, "")
E = Application.WorksheetFunction.Substitute(D, 4, "")
F = Application.WorksheetFunction.Substitute(E, 5, "")
G = Application.WorksheetFunction.Substitute(F, 6, "")
H = Application.WorksheetFunction.Substitute(G, 7, "")
I = Application.WorksheetFunction.Substitute(H, 8, "")
J = Application.WorksheetFunction.Substitute(I, 9, "")
Next M
FLW2 = J
End If
End Function
---------------------------------------
|
|