Click here to Skip to main content
15,918,211 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Sub Receipt()

Dim N As String
Dim D As Date
Dim Q As Integer
Dim P As Currency
Dim TC As Currency
Dim Disc As String

Q = Range("C4").Value
P = Range("C5").Value

TC = Q * P

Cells(7, 3).Value = TC

If P > 100 Then
Cells(8, 3).Value = "Bring this back next time for 20% off!"
Else: Cells(8, 3).Value = "Bring this back next time for 10% off!"
End If

End Sub

What I have tried:

I am just wanting to understand how this stuff works more. What will this do?
Posted
Updated 14-Apr-16 8:05am

1 solution

It reads two values from two particular cells, and multiplies them together.
It stores the result in a third cell, and check to see how big a discount the customer is allowed next time. That is displayed in a fourth cell.

To be honest, if you can't work that out, you need to go and get a book on this stuff and read it cover to cover - that is very, very basic stuff!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900