I have written the below code to calculate Discount Where Discount Slab 4 & Basic Price are Extracted from A Worksheet (File Attached).
While Debugging the code, when the Procedure reached "Basic Price" I am getting the following Error - "Object doesn't support this property or method"
Can someone clarify what is wrong?
Sub ShowDiscount()
Dim Qty As Integer
Dim Discount As Double
Dim DiscCal As Double
Dim BasicPrice As Double
Dim DiscP As Double
Qty = InputBox("Enter Purchase Quantity")
If Qty > 25 Then Discount = 0.1 'Discount Slab 1
If Qty > 50 Then Discount = 0.15 'Discount Slab 2
If Qty > 75 Then Discount = 0.2 'Discount Slab 3
If Qty > 100 Then Discount = ThisWorkbook.Sheets("Prices").Range("B15").Value 'Discount Slab 4
DiscCal = Discount * 100
BasicPrice = ThisWorkbook.Sheets("Prices").Range("B16").Values
DiscP = BasicPrice - (BasicPrice * DiscCal)
MsgBox "Discount of " & DiscCal & "% Calculated on Rs. " & BasicPrice
End Sub
Bookmarks