montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 986
- Office Version
- 2010
- Platform
- Windows
Hi.
Some sport event, the seating cost are orange seats $23.5. brown seats $19.75, and yellow seats $16.55. there is a tax of 6% on all seats.
the user can buy more than one seat, I need to know the cost of the seats with tax.
I tryed this but do not work
Thanks for reading
I hope to hear from you
Some sport event, the seating cost are orange seats $23.5. brown seats $19.75, and yellow seats $16.55. there is a tax of 6% on all seats.
the user can buy more than one seat, I need to know the cost of the seats with tax.
I tryed this but do not work
VBA Code:
Sub pseu()
'variables are: tickets, colour, price, cost, tax
Dim tickets As Integer
Dim color As String
Dim price As Integer
Dim cost As Integer
Dim tax As Integer
'enter number of tickets
tickets = Range("A1").Value
'enter colour of seats needed
Range("B1").Value = colour
'if the colour is orange then the price is 23.5
If colour = orange Then
price = 23.5
End If
' if the colour is brown then the price is 19.75
If colour = brown Then
price = 19.35
End If
' cost = number of tickets x price
cost = tickets * price
Range("C2").Value = cost
'tax = cost x 6 %
tax = (cost * 6) / 100
Range("E2").Value = tax
'tell the number of tickets, tax and total cost
Range("D1").Value = "tickets" & tickets & "colour) & colour"
End Sub
I hope to hear from you