要这样做
Dim sum As Double = 0vars("停止") = FalseFor i As Integer = 0 To 100000000 If vars("停止") Then Exit For sum = sum + i Application.doeventsNextmsgbox(sum)
click事件
vars("停止") = True