Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton1_Click()
- For i = 1 To 10
- Dim precio As Integer
- precio = Range(CStr("C" + 21 + i)).Value
- Dim x As Integer
- x = precio Mod 2
- If (x = 0) Then
- Range(CStr("E" + 21 + i)).Value = (precio * 0.3)
- Else
- Range(CStr("D" + 21 + i)).Value = (precio * 0.2)
- End If
- Next i
- End Sub
- Private Sub CommandButton2_Click()
- Dim total As Integer
- For i = 1 To 10
- Dim precio As Integer
- precio = Range("C" + CStr(21 + i)).Value
- total = total + precio - Range("E" + CStr(21 + i)).Value - Range("D" + CStr(21 + i)).Value
- Next i
- MsgBox ("El total a pagar es " + CStr(total))
- End Sub
- Private Sub CommandButton3_Click()
- Range("D22:E31").Value = ""
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement