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.
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
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.
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.
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.
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?
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.
I have 10 rows of 6 numbers, all between 1 & 49, in the range A1:F10. I also have the range A20:AW20, which are all currently blank cells. When I type a number between 1 and 49 inclusive into the range A20:AW20, any number that matches it in the range A1:F1 I want the cell to fill in colour.
I have information in A1. I want A1 to look at B2:B5 and D2:D5 (Under conditional formatting) and if there is one or more "X" in those cells to color A1 Grey (Fill). I keep trying to put a formula under conditional formatting, but it is only working for the first cell (B2) and not the rest.
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.
I have an error message that says: Run time error '1004': Unable to set the colorIndex property of the interior class. I attached code for your reference.
If (Range("B10").Value = "Gift" Or Range("B10").Value = "Entertainment") And Range("C10").Value = "" Then Range("C10").Interior.ColorIndex = 6 MsgBox "Please Fill in the Person's Name & Company." Range("C10").Select Range("C10").Interior.ColorIndex = 6 End If
I am trying to create a macro (which will go in an add-in, using Excel 2007) which will apply a custom format to any selected cells which have their formulae hidden (Format Cells, Protection, Hidden). A similar macro works fine for locked cells.
Here is the UDF I wrote, which returns True/False based on the Hidden status of a cell:
VB: Public Function Hidden(Check_Cell As Range) Hidden = Check_Cell.FormulaHidden = True End Function
just place all three pieces of code into a module, and change the first line of the two macros to a standard "Sub Macro1()" type format.
My macro works fine but I'm interested in seeing if I can speed it up. What I'm doing is starting at the bottom and comparing it with the row above and if they match in font color it will fill the top with orange and delete the bottom. This works but usually takes several minutes.
Public Sub ADMINCompareList() Dim varTest1, varTest2 Dim lng As Long, i As Integer, iTest As Integer Application. ScreenUpdating = False Worksheets("ADMIN").Activate For lng = ActiveSheet.UsedRange.Rows.Count To 2 Step -1 If Not Range("M" & lng).Font.Color <> Range("M" & lng - 1).Font.Color Then Goto newrow End If varTest1 = Intersect(Range("J:W"), Rows(lng)) varTest2 = Intersect(Range("J:W"), Rows(lng - 1)) For i = 1 To 14....................................
I have a workbook that contains 168 sheets of data (it's an extract from a PM tool) which is effectively a status report from each project in our portfolio. Contained within each status report are some financial data that shows a Plan number and a Forecast number for which I want to apply conditional formatting to this section (this is the same section for each sheet), to all the 168 sheets without having to go individually into each sheet. I have searched here and all the varying responses to a similar situation as mine, do not cater for the number of sheets that I have. And I need to do this on a monthly basis at monthend. So in the example below I want to apply conditional formatting if the Forecast (Cols D & G) are greater than Plan (Cols B & E). Is there a way of doing this just with the conditional formatting or would it need a VBA script?
Col A Col B Col C Col D Col E Col F Col G Financial Summary - Selected Project Currency: USD
My conditional formatting code works fine for one column; however, when I try to apply the conditional formatting to two columns, the code only applies to the first column listed. Additionally, I have two sets of "rules" that apply to the same column. One of the "rules" includes two columns. The other rule applies to only one column. I'm not sure if this is my issue, or whether I'm trying to apply the same code to two different columns.
I'm trying to find a macro to apply conditional formatting to a large number of cells,
What I would like to do is when cell E96 has a value of a, cells E3:F95 are shaded in grey. Then when cell G96 has a value of a, cells G3:H96 are shaded in grey, and so on down to IU96 having a value of a and cells IU3:IV96 shaded in grey.
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
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...
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?