Solved

vba Conditional Formatting if cell value < 19.5 or >20

Posted on 2011-09-08
4
201 Views
Last Modified: 2012-05-12
Hi,
I need a module to color all used cells in column (H) depending on the following criteria:
If cell value less than 19.5 then cell font color = Red and bold
or
If cell value greater than 20 then cell font color = Green and bold

thanks
Peter
0
Comment
Question by:ptp2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 36502323
Does it have to be code rather than just applying conditional formatting?
0
 
LVL 10

Accepted Solution

by:
ukerandi earned 500 total points
ID: 36502382
Enter value in H column click on Run button
answerColor.xls
0
 
LVL 1

Author Closing Comment

by:ptp2
ID: 36502475
Thanks for your quick response - another problem beaten!
0
 
LVL 1

Author Comment

by:ptp2
ID: 36509052
H ukerandii, I know I accepted your answer as the test data you sent worked perfectly exacly as I wanted but I have a problem in that the first cell in column H contains header information and when I run the module I get an error Run Time error 13 Type mismatch on line val1 = Cells(count, 8).
If you want I will resubmit my request with the header criteria as I know it was my fault for giving you clear information.
Thanks
Peter
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question