• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to do conditional formatting with Macro

I have taken a sample data from the source data to explain what I want.
I wanted to highlight loss nos greater than average in each state for eg greater than 41 in case of Tamil Nadu state.
I recorded macro by naming macro as highlight cells and giving shortcut key as CTL+Shift+H, applied conditional formatting greater than average and stopped macro.
Then I selected the Count of location of AndharaPradesh state and pressed CTL+Shift+H so that it would highlight greater than average but it did not work please help.
 

Attachments

Yes thanks It worked well but difficult to understand code. but I am getting wrong highlighting information due to high number of 0 count in nos of particular state. Also I wanted to highlight average column which is greater than average of particular state.
Thanks once again for helping me out.
Please find the attached file.
 

Attachments

Hi,

The formula which you applied in conditional formatting worked but since there were zeros under count of location, I am getting unexpected results. For eg in attached sheet. If you look at Uttar Pradesh State Average comes around 06 omitting zeroes but your formula calculates average as 03 as it considers 0
Also I wanted to highlight column E which is greater than state average for eg Location of Tamil Nadu that are greater than state average i.e 17453 will be highlighted.
 
Back
Top