vba Conditional Formatting if cell value < 19.5 or >20

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
LVL 1
ptp2Asked:
Who is Participating?
 
ukerandiCommented:
Enter value in H column click on Run button
answerColor.xls
0
 
Rory ArchibaldCommented:
Does it have to be code rather than just applying conditional formatting?
0
 
ptp2Author Commented:
Thanks for your quick response - another problem beaten!
0
 
ptp2Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.