Comparing the active cell value against another value in the row

G

Guest

I have two values in a row, I want to click on the active cell and have it
display a calculation based on the value in the active cell versus a fixed
cell in the same row. I have tried to use the msgbox function but can't seem
to make it work. The values are consist of a customer discount off list
versus a dealer discount off list. I need to calculate the margin based on
these two values. The formula is 1-((1-dealer discount)/(1-customer
discount)). Can this be done in Visual basic?
 
M

mrice

I would suggest a simple macro based upon the Worksheet_SelectionChang
event

Something like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target = "" Then Exit Sub
MsgBox Target - Range("A1")
End Sub

for a simple subtraction which you can amend for your specific formula
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top