Solved

vba Conditional Formatting if cell value < 19.5 or >20

Posted on 2011-09-08
4
196 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
  • 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now