+ Reply to Thread
Results 1 to 2 of 2

Recording a high price on a worksheet

  1. #1
    Lou New At Excel
    Guest

    Recording a high price on a worksheet

    I need to know the highest price I have ever paid for a product. In my
    inventory, I update prices monthly, changing the previously recorded price.
    If the "new price" is more than the price recorded in the "high price"
    column, I want that price to change to the "new Price" amount. I have tried
    using the MAX formula in conjunction with the IF formula, but it is not
    working properly because if the "New Price" is in between the two prices, it
    records that "new price". Any suggestions? Note: I am pretty much a novice
    at this so please try to keep it simple.

  2. #2
    Ardus Petus
    Guest

    Re: Recording a high price on a worksheet

    You will need some VBA code.

    Right-click on tab name,
    Paste following code
    Adjust Range("A:A") to suit your own "new price" column (eg: "G:G")
    Close VBA

    Et voilà!

    I reckon it is not as simple as you could expect!

    HTH
    --
    AP

    '-----------
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim myRange As Range
    Dim myCell As Range
    Set myRange = Intersect(Target, Range("A:A"))
    If Not myRange Is Nothing Then
    For Each myCell In myRange
    With myCell
    If .Value > .Offset(0, 1).Value Then _
    .Offset(0, 1).Value = .Value
    End With
    Next myCell
    End If

    End Sub

    "Lou New At Excel" <Lou New At [email protected]> a écrit dans
    le message de news:[email protected]...
    > I need to know the highest price I have ever paid for a product. In my
    > inventory, I update prices monthly, changing the previously recorded

    price.
    > If the "new price" is more than the price recorded in the "high price"
    > column, I want that price to change to the "new Price" amount. I have

    tried
    > using the MAX formula in conjunction with the IF formula, but it is not
    > working properly because if the "New Price" is in between the two prices,

    it
    > records that "new price". Any suggestions? Note: I am pretty much a

    novice
    > at this so please try to keep it simple.




+ 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