VBA Highlight Highest & Second Highest Value In Each Column

  • Hi, I wonder whether someone could possibly help me please.


    I'm trying to put together a script which will highlight the highest and second highest value for each column in a given range for multiple sheets.


    I've started the script off below, which I think correctly creates the array of sheets and the starting row of each column.


    Now I did try to get some help here: http://www.excelforum.com/exce…ighlight-max-numbers.html but as you will see I seem to have hit a bit of brick wall.


    I just wondered whether someone could possibly look at this please, and offer some guidance on how I may go about achieiving this.


    Thank you and kind regards

  • Re: VBA Highlight Highest & Second Highest Value In Each Column


    This should work, I changed your sheet names for testing purposes.




    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: VBA Highlight Highest & Second Highest Value In Each Column


    Hi yegarboy, thank you very much for taking the time to reply to my post.


    The code works, but it starts searching at row 4 which is the header row. Could you possibly tell me please how I may be able to make the change to start at row 5.


    Many thanks and kind regards

  • Re: VBA Highlight Highest & Second Highest Value In Each Column


    This line contains the Starting Row. Change the 1 to a 5 like this and you should be good to go.


    Code
    Set rng = .Range(.Cells(5, lCol), .Cells(lLastRow, lCol))

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: VBA Highlight Highest & Second Highest Value In Each Column


    Hi


    I was looking at this post yesterday, prepared a file and someone came over, disturbed me and took me away. I did not get back to my desk for hours and forgot to post a reply. Sorry if this is old now but I think this method has merrit.


    I used Conditional formatting to achieve the highlighting of the first and second ranked figures in a column. File attached to prove workings.


    Take care


    Smallman

  • Re: VBA Highlight Highest & Second Highest Value In Each Column


    Hi Smallman, thank you for taking the time to reply to my post and for the solution. It is greatly appreciated.


    Many thanks and kind regards

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!