Private Sub CommandButton1_Click() Dim M As String Dim S, A As Integer Dim N, C, PT, GT As Integer Dim B1, B2 As Double M = TextBox1 S = TextBox1 N = TextBox2 A = TextBox2 C = 20 If (A > 2 And A < 5) Then If (M = "A") Then B1 = 0.2 * A R = 0.8 * 1.5 * C Else PT = (N * 1.5 * C) + R * N If (A >= 5) Then GT = PT - (C * 1.5 * N) B1 = 0.3 * A Else End If If (M = "B") Then End If R = 0.95 * 1.8 * C If (S <= 1000) Then PT = (N * 1.8 * C) + R * N B2 = S * 0.25 GT = PT - (C * 1.8 * N) Else End If If (S > 1000 And S <= 3500) Then End If B2 = S * 0.15 TextBox3 = PT Else TextBox4 = GT If (S > 3500) Then End Sub B2 = S * 0.1 End If End If End If If (B1 > B2) Then B = B1 Else If (B2 > B1) Then B = B2 End If End If TextBox3 = B