• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

macro with if statement

Dalia

Member
why below macro not happening
its showing discount 0 for all condition
Sub discount()
Dim quantity As Variant
Dim discount As Integer
quantity = InputBox("enter ther quantity")
If quantity = "" Then Exit Sub
If quantity = 0 Then discount = 0.1
If quantity > 0 And quantity <= 25 Then discount = 0.15
If quantity > 25 And quantity < 75 Then discount = 0.25
MsgBox "discount " & discount

End Sub
 
Back
Top