Conditional Formatting: : Font Color Also
Jul 17, 2006
I found in the web-site a great VBA code that replaces the "Conditional Formatting" option in Excel. The problem is that it changes the "fill color" and I also want to change the "font color".
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("C4:C14")) Is Nothing Then
Select Case Target
Case 0
icolor = 2
Case 1
icolor = 4
Case 2
icolor = 39
Case 3
icolor = 45
Case 4
icolor = 37
Case 5
icolor = 15
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
View 2 Replies
ADVERTISEMENT
Jul 6, 2009
I'm using Excel 2003.
I have four conditions that dictate font colors in column "d" of "sheet1" and am using the following
Private Sub Font_Change(ByVal Target As Range)
Set Myrange = Range("D2:D1000")
For Each Cell In Myrange
If Cell.Value = "Started" Then
Cell.Interior.ColorIndex = 3
End If
If Cell.Value = "Pending" Then
Cell.Interior.ColorIndex = 4
End If
If Cell.Value = "On-going" Then
Cell.Interior.ColorIndex = 18
End If
If Cell.Value = "Completed" Then
Cell.Interior.ColorIndex = 6
End If
Next
End Sub
1. Does this code look valid?
2. Do I paste the code in a "module" or in a worksheet object? If I add this to a module, how does the code know to reference sheet1?
3. Is there a handy reference guide that shows color codes? If so, where can I get a copy.
View 9 Replies
View Related
May 11, 2006
Using conditional formatting I can change the font color (to blue) of a cell if it meets a certain criteria. Now what I would like is to display a message when the color changes to blue. The cell range is E26 to E40.
View 9 Replies
View Related
Feb 7, 2014
I work with some stock index data and I would like to get rid of some dots and empty spaces etc. I used conditional formatting and changed the font color of all the values I need. When I try to sort them based on font color (in order to delete the empty spaces/dots) Excel does not do it. "Go to...conditional formatting" also doesn't work.
View 5 Replies
View Related
Jul 8, 2008
I have a simple sheet that has columns I-K. My issue is that in column K I am dividing J/I. If both J and I cells have a "0" then I get the #DIV0 error. If both J and I cells are blank then I get the #VALUE! error. I need it so that if the cells in J and I have a zero in them then it places a 0 in K. But if both J and I are blank then it puts something else that I can have Conditional formatting change the font color so column K looks blank. I think the IF formulas I am try to use recognize blank cells as zeros as well.
View 9 Replies
View Related
Mar 5, 2007
Cell B157 is changed by checkbox 1= TRUE, 0 = FALSE
Cell H1 and Cell H2 are percentages changed by the user.
Range(AI8:AQ8,AI12:AQ12,AI16:AQ16,AI20:AQ20, etc) each cell in the range contains a formula, and is protected from the user.
I need the contents of each cell in the range to change font color (independent of each other) when the formula of any of the cells within the range changes - to the following
If B157 = 1
Cells < H1 (a percentage changed by user), would turn Red
Cells > H1 but < H2 (a percentage changed by user) would turn Yellow
Cells > H2 would be Green
If B157 = 0
Cells < H1 (a percentage changed by user), would turn Green
Cells > H1 but < H2 (a percentage changed by user) would turn Yellow
Cells > H2 would be Red
I need it to fire whenever the value of one of the cells in the range changes.
I have tried If statements, Select Case, and a combination of both but just can't get it!
View 9 Replies
View Related
May 22, 2014
I m unable to apply conditional formatting with numbers ( font and fill of same color).
like:-
if press 1 , cell and font should be of same color and if 2 with different color and so on
as of now either formula is applying on cell or font but not on both
View 1 Replies
View Related
Jun 26, 2013
Via conditional formatting, I am searching to change the color of a specific word in a cell (not the color of everything in the cell, but only that specific word - and the word repeats in the cell). A function such as =isnumber(search("NOK";A1)) colors all the cell values, which I do not want to do. How i can perform this task?
View 1 Replies
View Related
Oct 19, 2006
I have two conditions setup in Options>View - Zero Values.", "style="background: #FFFFFF;padding: 2px;font-size: 10px;width: 550px;"");' onmouseout='GAL_hidepopup();'>formatting.htm" target="_blank">conditional formatting. The first is setup for alternate row coloring with this formula inside Conditional Formatting:
Formula is = MOD(ROW(),2)
My Second Condition is
Cell Value is between $P$10 and $Q$10. This sets the font bold and a different color. The two cell values are two dates. I want to change the cells font color and bolding as long as the value is within that date range. It works fine, but for cells that are on the row that is colored the second condition doesn't apply for some reason.
View 7 Replies
View Related
Jun 21, 2013
I am looking to create a VBA that looks down a certain column and changes the font to red or green depending on the text in the cells in the column. If text = p then Green, If text = q then Red.This is the script I have (red only) how to incorporate the above criteria.Also the script in its current format comes up with an error.
Code:
Sub ConditionalFormat()
Sheets("Sheet1").Activate
Worksheets("Sheet1").Select
[Code].....
View 6 Replies
View Related
May 20, 2014
I am currently creating a dashboard for my business unit.
I have text boxes in the "Dashboard" worksheet linked to cells in the "Data" worksheet.
I would like the text boxes font color to automatically update based on updates I make to the "Data" worksheet.
Example: 100% of target, font changes to Green. 75% of target, font changes to Yellow. 50% of target, font changes to Red.
View 4 Replies
View Related
Jun 27, 2008
I have backwards co-workers that can't figure out how/why to use conditional formatting and have deigned it "not acceptable".
They've requested I fill in a HUGE spreadsheet and change the font color to red if it meets a criteria.
Simple enough to do with a conditional format that compares my data.
HOWEVER, now I need the individual cells to stay red and remove the conditional format (because conditional formatting "confuses" them). Removing the condition causes the color to go back to black. I've tried all sorts of paste specials (formula/format) to no avail...
View 9 Replies
View Related
May 26, 2009
Is it possible to write VBA code that will prevent a user from changing a cell's contents, depending on the cell's font color?
More specifically, I have a column of text in range B15:B64. Some of the cells will have a black font, others will be blue. Is it possible to lock the black font cells only, leaving the blue cells unlocked for users to change?
View 9 Replies
View Related
Nov 24, 2013
I want to change Font Size ,when Conditional formatting is used in a range.
I know , it is not possible with conditional formatting basic application.
I need a macro code, if possible to do it.
View 3 Replies
View Related
Apr 29, 2014
Please refer to attached file.
I have data in cell B2:K11
Each cell consist of 12 digits with 1 and 0.
I need to see if digit 1 can have one color font (yellow) and 0 can have other color font (light Orange).
(Either VB Code or Formula would work for me).
View 5 Replies
View Related
Oct 3, 2009
If a cell cntent includes a symbol [as an arrow, for instance] beside the text,the font colour does not change as required when the condition is met.
View 2 Replies
View Related
Jul 18, 2013
I am trying to set up conditional formatting in cell C4 to change the font to a smaller number based on the value of C4. If C4 = 0 then Font Calibri 16, otherwise Font Calibri 24. However, the font size is not availabe, it is greyed out. Is there another way to accomplish this without using VBA? In the worksheet could I use an if() statement to change the font size?
View 6 Replies
View Related
Jan 25, 2010
The entries are made in Columns A thru C. In Columns F and G I want any value over 100% to have a red background, any value less than 100% to have regular formatting, and I'd want percentages to have white font if an employee is deleted from Column A.
Here's an example of how I have the formatting set up:
Condition 1: Formula is =$E$2="" --->white font
Condition 2: Cell value is >1 ---->red background
Condition 3 Cell value is </= 1 ---->normal format
View 3 Replies
View Related
Nov 28, 2012
Excel 2003.
I am creating a heat map using two variables from a questionnaire: firstly the number of people impacted by a question; and secondly, the level of the impact. Respondents are asked to give these values in two adjacent cells. These are then multiplied to give a weight eg 1000 people x level 3 impact = 3000. I have used Conditional Formatting to colour the cell according to the impact level (0 = none - white (default), 1 = moderate - tan, 2 = significant - orange, 3 = high - red). What I want to do is then change the font size to give an indication of the number of people impacted, eg 1 - 1000 font 8, 1001 - 3000 font 12, 3001 - 8000 font 16, 8000 - 2000 font 24 etc. The size of font and colour will then represent the number of respondents and their impact.
I can't use Conditional Formatting as the value of 3000 could be derived from 1000 people at level 3 (red), or 3000 people at level 1 (tan). Is there another way of setting the font size depending on the cell value, eg by VBA?
View 9 Replies
View Related
Apr 8, 2009
I want every even row that has a value in it to have a different fill color (same color for all). how to do it? I am using 2007.
View 5 Replies
View Related
Dec 18, 2013
I have a column of student grades & accumulated credits.
1.) I would like to apply a CF formula which turns the cell GREEN when a score is above 65 else RED below 65.
2.) Also I would like to turn another cell GREEN if a student has accumulated the required # of credits listed in another cell else RED.
View 4 Replies
View Related
Jun 11, 2014
Color Scale Conditional Formatting
I want to use formula to define Minimum, Midpoint and Maximum in the color scale, but am not able to achieve it.
My Criteria are as follows;
Minimum: Less than equals to 50%
Midpoint: More than 50% less than 70%
Maximum: More than 70%
I need this formula for Accuracy column only.
View 3 Replies
View Related
May 28, 2014
We have a spreadsheet that is sent to a manager weekly. The manager takes the sheets from 30+ individuals and copies all into a single workbook that is then distributed to a very large audience and reviewed weekly. In this workbook, I have created drop downs with conditional formatting - Low = Green, Medium = Yellow, Critical = Red. On the original workbook, this formatting works great, however, after the manager consolidates and redistributes all worksheets the Green shows Gray, Yellow is OK and Red shows Black.
View 2 Replies
View Related
May 19, 2009
I am using the following formula on a conditional formatting to color cell A1 based on cell N5 date =$N5=TODAY()-2
The problem is that I need this formula to consider only weekdays, how can apply formula weekdays to my formula?
View 6 Replies
View Related
Aug 11, 2009
When using conditional formatting, I have it set to the following:
C2=60 (Reference Cell)
C3=5 (Reference Cell)
Conditional Format Settings
If C3 >= C2/12 then pattern set to Green
If C3 < C2/12 then pattern set to Red
Here is the problem - when you have a value in C3, everything is fine, it's either green or red. If C3 is blank, it defaults to green because the conditional format is true.
Is there anyway to add something in there to have no color when C3 is not populated?
View 11 Replies
View Related
Dec 11, 2013
I have a column that when I put info in it gives me a colour, now on this I have quit a few different labels, eg. AAG201, PRA001, 000010 and so on, now on my rule I have put in that if it is PRA* ,AAG* to be one colour and 0000* to be a colour. (this is working without a problem).
I have tried to get the rest of the row to be the same colour, but cannot get te rules to work, I do not know which rule to use to get this working.
View 10 Replies
View Related
Jan 19, 2012
I need to assign 3 critera for Red and similarly for Green 3 Criteria ..
For ex: Red:"3yr"≤40%
View 9 Replies
View Related
Aug 13, 2007
Is there any way to count a list that has been highlighted by conditional formatting?
View 9 Replies
View Related
Jun 22, 2006
I am trying to write a VBA code to color cells.
In Column I
I need a formula to change the color of the cell based upon the following criteria
In cell I3, if J3>7 change color to teal, if H3<$A$1 color cell red, if J3<7 color cell yellow, if J3="COMPLETE" color cell grey, otherwise do nothing.
View 6 Replies
View Related
Feb 14, 2007
suppose I have the numbers 1-25 in a column. I want to color the numbers 1,4,7,10,13,16,19,22,25 green, color 2,5,8,11,...25 orange and color 3,6,9,12...25 red. I can not set up the conditional formatting formulas correctly.
View 2 Replies
View Related