+ Reply to Thread
Results 1 to 3 of 3

Macro to highlight value of cheapest supplier ?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,695

    Macro to highlight value of cheapest supplier ?

    abc xyz zyz
    100 90 80 zyz
    50 60 70 abc

    Have a formula that quotes the supplier at
    cell D2 , is there a macro that will highlight
    the minimum value each line that is 80 and
    50 to be highlighted

    Yes I know =min(a2:d2) will do the work

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to highlight value of cheapest supplier ?

    Here is one way to do it:

    Sub Highlight_Min()
    Dim ws As Worksheet:    Set ws = Sheets("Sheet1") 'you may need to change this
    Dim i As Long, minValue As Long
    Dim rCell As Range
    
    For i = 2 To ws.Range("D" & Rows.Count).End(xlUp).Row
        minValue = Application.WorksheetFunction.Min(ws.Range("A" & i, "D" & i)) 'assuming column A to D as per post
            For Each rCell In ws.Range("A" & i, "D" & i)
                If rCell.Value = minValue Then
                    rCell.Interior.ColorIndex = 6
                    Exit For
                End If
            Next rCell
    Next i
    
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,695

    Re: Macro to highlight value of cheapest supplier ?

    Yes , would imagine how automated that would
    be if had real raw data going on it , thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Cheapest supplier 3 columsn , 2 I know
    By makinmomb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-21-2014, 01:55 PM
  2. I have supplier name in excel.. I need a VBA to the Supplier Web URL
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2013, 01:25 AM
  3. [SOLVED] How to list the cheapest supplier for certain products
    By Yelik in forum Excel General
    Replies: 7
    Last Post: 11-05-2012, 02:44 AM
  4. Replies: 1
    Last Post: 04-20-2012, 04:49 PM
  5. cheapest price
    By craigproudfoot in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-10-2005, 02:00 PM

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