Hello Everyone,
I am trying to make a macro that will always return a certain rebate percentage based on a defined growth rate. I wrote the formula in its respective cell, and recorded a macro, but the worksheet itself is a template that needs to be flexible for various amounts of data. I cannot include the entire worksheet due to some sensitive information, but I have attached a file with the two columns where my problem is occuring. Also, here is the current VBA code for my macro (this is for my bigger sheet so the column numbers are different):
Sub Rebate()
'
' Rebate Macro
'
'
Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=""Rebate: ""&IF(OR(R213C11>=0.15,R213C11<=0.19),""2%"",IF(OR(R213C11>=0.2,R213C11<=0.25),""3%"",IF(R213C11>=0.26,""4%"","0%")))"
Range("L14").Select
End Sub
Basically, I need something that will always refer to the last cell in the column directly to the left (in the worksheet it says 16%). How can I edit the above code to allow me to do this? If you need more specification, let me know. Thanks for all of your help.
Bookmarks