+ Reply to Thread
Results 1 to 2 of 2

Comparing the active cell value against another value in the row

  1. #1
    Clayton
    Guest

    Comparing the active cell value against another value in the row

    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?

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    I would suggest a simple macro based upon the Worksheet_SelectionChange 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.
    Martin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1