Private Sub CommandButton1_Click() Range("b4").Select ActiveCell.Formula = "=max(a1:a3)" ma = ActiveCell.Value Range("b4").Select ActiveCell.Formula = "=max(b1:b3)" mb = ActiveCell.Value m = ma - mb Range("b4").Select If m > 0 Then ActiveCell.Formula = "大于零" ElseIf m = 0 Then ActiveCell.Formula = "等于零" Else ActiveCell.Formula = "小于零" End If End Sub
②m = ma - mb Range("b4").Select If m > 0 Then ActiveCell.Formula = "大于零" ElseIf m = 0 Then ActiveCell.Formula = "等于零" Else ActiveCell.Formula = "小于零" End If