Showing price discount, but hiding price increase...need help with current code.

kyle_vk

New Member
Joined
Jun 30, 2014
Messages
9
I've been building a workbook to do Quotes/Purchase Orders/Order Confirmations..etc. I have a macro which gives a pop up window to enter a price percentage discount/increase. It works fine and shows the amount discounted/increased into the active cell. However, even though clients love seeing the discount number...sometimes we end up increasing the price due to whatever the circumstances may be, and we do not want them to see that. Is there a way to have this macro show the number if its negative, and leave it blank if its 0 or posetive (but still apply the price increase)...? Any guidance would be great, here is what i have working right now.


Sub Disount()
Dim Ans As String
Dim AkMsg As Variant
Dim Sum, Ans2 As Single
ActiveCell.FormulaR1C1 = "=SUM(R[-13]C:R[-1]C)"
Sum = ActiveCell.Value
Ans = InputBox("Discount Amount") 'the user will enter a number (percentage), i need the user to enter only a number and macro to add "%" behind it.
If StrPtr(Ans) = 0 Or Ans = "" Then 'if the user cancel or didnot enter a number this is what macro does
Exit Sub
Else
Range("F30").Select
ActiveCell.Value = -(Sum * (Val(Ans) / 100)) '
End If
End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Actually i didn't think that through all the way...I guess what i'd like to accomplish is to be able to increase each line item by a percentage so that the total will match the sum of the line totals. the way i described it above would make it an obvious price increase if anyone felt like doing a little math when the looked at the quote. (the reason we have this is because sometimes the more rare woods we work with can have random price changes and this way we don't have to constantly be changing our master price list for just a few items. )

Thanks!
 
Upvote 0
For what its worth, I am trying to figure this out...but struggling.

To explain it maybe a bit simpler...I'm trying to do this...

Private Sub Price_Increase()

Range("E13:E26").Value = Range(E13:E26").Value * (1+% which would be inputed using an Input box as used in the formula above....)
End Sub


Any one have any ideas? I feel like this isn't too crazy but i'm failing to "reverse engineer" the discount macro that i have working...
 
Upvote 0

Forum statistics

Threads
1,215,487
Messages
6,125,073
Members
449,205
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top