楼主加密了vba,我按照楼主表格把vba自己弄出来了 Wp3l>:
Private Sub CB1_Click() Q{hOn]"
Dim Fst1, Fst2, FRi, Fsi As Double qEr[fC@x
Fst1 = Sheet1.Cells(2, 21).Value #UD
n1 = Sheet1.Cells(4, 1).Value CD[=z)<z{
FRi = 0 YO0x68
Fsi = 0 66^t[[
flag = 1 Xy<f_
While flag = 1 qXGLv4c`Q
FRi = 0 neFno5d j
Fsi = 0 x{V>(d'p
For i = 1 To n1 \#,#_
FRi = FRi + Sheet1.Cells(5 + i, 18).Value QvN
<uxm
If i = 1 Then 3uG5b8?
Fsi = Fsi + Sheet1.Cells(5 + i, 19).Value - Sheet1.Cells(5 + i, 20).Value R7c)C8/~
ElseIf i = n1 Then Bqlc+d:
Fsi = Fsi + Sheet1.Cells(5 + i, 19).Value + Sheet1.Cells(4 + i, 20).Value * Sheet1.Cells(5 + i, 17).Value F$p*G][
Else ^3o8F
Fsi = Fsi + Sheet1.Cells(5 + i, 19).Value + Sheet1.Cells(4 + i, 20).Value * Sheet1.Cells(5 + i, 17).Value - Sheet1.Cells(5 + i, 20).Value '|N4fbZd
End If F)kLlsp
Next WC*:\:mh
Fst2 = FRi / Fsi uN3J)@;_
If Abs(Fst2 - Fst1) < 0.0000000001 Then _hL4@C
flag = 0 -L?%
o_
Fst1 = Fst2 A!Ct,%
Sheet1.Cells(2, 21).Value = Fst1 A;a(n\Sy
Else W?J[K;<
Fst1 = Fst2 E(+wl
Sheet1.Cells(2, 21).Value = Fst1 B2qq C-hw?
End If SJ7=<y}[d
Wend FXEfD"
End Sub