Macro For Changing Colors In Cells?
Mar 13, 2012
I have a worksheet where I want the to change the collor of a range of cells in accordance to the value in another range of cells.
So if the value is "Gron" in cells C4:C27 then I want cells J4:J27 to return the color green. If, however, the value is "Rod" in cells C4:C27 then I want cells J4:J27 to return the color red.
View 9 Replies
ADVERTISEMENT
Mar 22, 2008
I'm a average excel user, i know my way around it and kow common and basic formulee, VB isnt a strong point, but i am willing to attemp anything for this, let me explain
Lets say in colum A I have a list of items, in colum B i have a check box, currently the check box is red, if i tpye a x it turns green due to conditional formating. That works fine...onto the problem...
Lets say in colum A i have my items but they are repeated...eg A1, A145, A166, A122 are all the same item, what i want is regardless of where i place the x each check box under coloum B either gets a X and turns green, or just turns green, i dont mind...
I dont think conditional formatting can cut this, though i may be wrong. Ive tried to use the IF function under condtional formatting but ran into problems...
View 9 Replies
View Related
Jan 12, 2009
When a workbook is opened, (using OnOpen() ), I trying to get two header titles colors (A2, B2) to change from their usual Black to Red to Black to Red and finally back to Back.
I'm battling, especially with the time (1 second) for each change. I'm probably using the wrong approach. Can anyone suggest a sound method to achieve this?
View 6 Replies
View Related
Apr 3, 2012
Trying to format cells b9 through b 24 and cells c9 through c24 to change from white to a light grey color by clicking the mouse button once. so one click white, another click grey. The color grey I need is white, background 1, darker 25% in the autofill field in excel. I have search other forums they all lead to changing the code, I did this already. just copy pasted a code I found but all cells were selected to change a bright green.
View 3 Replies
View Related
Dec 15, 2007
I have 2 cells (B2 and C2) with date format, showing dates from a calendar.
FYI, These cells are NOT in my Calendar.
Now, I need to write a formula for my calendar cells to check these two cells (B2 and C2) and change the color of the cells inside my calendar according to the date sindicated inthese two cells (B2 and C2).
I did this with numbers using conditional formating and it works perfect but doing this with dates is giving me a hard time. Is there a way to do this? below is a link to my excel file.
http://www.box.net/shared/si7g77l0b8
View 9 Replies
View Related
Mar 17, 2007
I'm trying to have change if the date on it is passed "now()". I am already using the 3 conditional formatting fields and need this one and another one. Here are 2 problems I seem to be having.
First - the code below only works if I change the date on the cell. I want code to either work with Worksheet Active or any other way so the user does not have to redo the date’s everyday.
Second - a record might have conditional formatting already. Is it possible for the target cell in this code can show this color while the rest of the row shows the color of the conditional formatting?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("G1:G2000")) Is Nothing Then
Select Case Target
Case Is <= Now()
icolor = 39
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
View 7 Replies
View Related
Feb 12, 2010
Conditional format for changing font colors using VBA
Its Working.
View 2 Replies
View Related
Apr 5, 2007
i'd like to use a macro to loop through a range of cells and change the interior color index based on the cell values (ex. if cell value < 10, set interior to blue, if cell value > 400, set to green) i'm trying a for each loop with an if statement but i keep getting syntax errors, i know this is probably a simple problem but i'm not experienced in vb,
View 4 Replies
View Related
Sep 25, 2009
I have the following Case statement that changes all the cells to the correct color, but does not change the Font color as specified in the Case. All the text is White (fcolor = 2) instead of just the 3 types of cells specified.
View 2 Replies
View Related
Jan 29, 2009
so I know how to change the color of a command button(right click, properties), but is there a way to change the color to a specific red green blue range? lets say 102 28 02 for example
View 2 Replies
View Related
Feb 19, 2014
I have a large workbook, with multiple sheets. I would like to be able to select a name from a drop down menu, and have the cell color change for all entries of that name in my other sheets. I can do it manually, but it would be much cleaner and easier to have Excel do it for me. I have looked at other answers here on this forum and know that if it can be done,
View 1 Replies
View Related
Jul 7, 2013
My pallet lost color-coding - if I hover over each little scare it displays the names for the colors and if I click on them they color the cells with the right colors, but the palette itself lost the visual display of colors except for 8 colors: black, blue, red, magenta, yellow, cyan, and white.
I use color-coding of cells a lot and I find it difficult to work without visual clues. At least the hover-support allows me to get the work done, but with difficulty.
View 12 Replies
View Related
Aug 7, 2014
What my code needs to do: It needs to verify data in column rows say for this example columns A to C and infinite rows. It needs to verify the data in this order A1, B1, C1, A2, B2, C3 etc. (One of the part I have problems to do) It also needs to add to a row/cell "1" when certain conditions. (In the same line as the last checked data in the column "D" say for exemple last data that was checked is "A3" well the 1 must be written in "D3". The conditions are simple the first Data the macro encounters must be higher than 0.25 and all following data must be higher than 6, whenever the next data is lower than 6 or empty add 1 to the corresponding D row and restart at the 0.25 cell "checking".
View 2 Replies
View Related
Dec 20, 2006
I have button in the Excel sheet.When I click the button the following code got triggered.
Sub Button1_Click() 'YieldCurveGet
Dim arrayData As String
Dim CurveString As String
'arrayData = "Test,Test1....." '(for eg)
arrayData = WorksheetFunction.RTD("OrcExcel.RTDServer", "", "YieldCurveGet", "AUD yield curve", "AUD", Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null)
CurveString = Split(arrayData, ",")
i = -1
For x = 1 To (UBound(CurveString) / 2)
i = i + 1
range("C" & x) = CurveString(i)
i = i + 1
range("D" & x) = CurveString(i)
Next x
End Sub
After triggered get invoked I need to set value of "arrayData " from VBA to Excel.Iam not sure what's going wrong.I cannot see the value in the Excel.
View 8 Replies
View Related
Apr 22, 2014
I need to change the color of a specific cell when conditions are met in a different cell and it seems like it may be beyond the scope of simply applying conditional formatting. What vba code would look like in proper syntax to make the following statement true. IF cell value Q4 is >=cell value S4 AND cell value R4 is <100 Then cell Q4 turns red and IF cell value Q4 is >= cell value S4 AND cell value R4 =100 then cell Q4 turns green. it may also be useful to know that the "cell values" in this example will be dates and not straight values. this may be possible to do using conditional formatting, but i cannot find a formula that works.
View 2 Replies
View Related
Oct 21, 2008
I have an excel sheet in which many cells have a background color of Green. These cells are located all over the sheet. I want to change the background color from Green to Red not affecting the color of other cells in the sheet.
I will be realy really thankful, as I have to do this exercise for more than 50 worksheets.......If I start doing it manually by selecting each celll with green color background and changing it to red.....you can well imagine my condition.....my life would get shorten significantly while doing this.
View 6 Replies
View Related
Jun 17, 2013
I'm trying to create a macro that will change the color of the cells I've selected to green. My selection will vary depending on what cells I'm trying to color green (not a fixed range). My current code only changes one cell of my selected range:
Sub IN_PCA()
'
' IN_PCA Macro
'
'
ActiveCell.Select
Range("M243").Activate
With Selection.Interior
[Code] .......
I've tried using "ActiveRange" in lieu of "ActiveCell" as well as other commands that would seem to be correct but have failed.
View 3 Replies
View Related
Jan 5, 2009
I have an excel sheet which is protected (mainly so that the users will not change any formulas) the excel sheet is basically a list
Just to put you in the picture
Column B Is PO Number
Column C Is Remarks
Column D Date
Column E Description
Column F Supplier
Column G Amount
I would like that when Column C changes to "OK Checked" column B C D E F G are protected and locked. But obviously for that particular row.
For example the input of Cell C15 changes to "OK Checked" then B15, C15,E15,F15,G15.
the macro must NOT be fixed to a particular row (in this case 15)
View 9 Replies
View Related
Mar 26, 2008
I am trying to create a Holiday/Absence Sheet that will count up hours of Holidays, absence, business Visits etc etc.
The only way I can think of doing this is by colour and filling the cells with the Number of hours holidays, Absence & Business Visits but to do this I need to create a formula that will sum by colour. I've tried a variety of things and I'm sure this can be done using VBA but it's something I have never used so I am at a loss.
So, what I need is a SUM (A1:A31 if colour= Red) and SUM (A1:A31 if colour= Blue) etc.
I hope this makes sense or one of you geniuses out there can come up with somethign smart that works better than my idea!
View 6 Replies
View Related
Mar 4, 2012
I have a Macro 'Timenow' to give current time in a Cell of MS Excel, but then it changes all Cell values of sheet where the macro was used.
Sub Timenow()
'
' Timenow Macro
' Keyboard Shortcut: Ctrl+b
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.NumberFormat = "h:mm"
Range("F5").Select
End Sub
Even assigning value to variable does not work:
Sub Timenow()
' Timenow Macro
' Keyboard Shortcut: Ctrl+b
Dim TN As String
TN = Format("=now()", "h:mm")
ActiveCell.Value = TN
End Sub
how to restrict the macro to change the value of current/active cell only without effecting other cell values?
View 4 Replies
View Related
Sep 15, 2013
How do I go about formatting selected cells for different colors for each different number in the selected cells? If I have numbers scattered about I want the cell to show a different color depending on the number that is inserted. EG: 115=red, 365=blue.
View 2 Replies
View Related
Sep 24, 2009
I'm trying to get a range of cells to change colors. This should happen from VBA code and happen on specified sheet that is not the default sheet when the userform appears that has the button that triggers the event. I have to reference the range with variables because it changes depending on other events.
If I put in: ....
View 9 Replies
View Related
Sep 8, 2009
We have a workbook with over 20 worksheets, each sheet with one or more tables in it. Several people use the workbook and we have decided that when someone changes a cell, they should mark the changed cell by filling it with blue using Format Cell. We have then nominated one person at end of each week who will check all the changes made during the week and either approve or reject them. So her task is to find all the blue cells, check them and then take the shading off.
What I would like to do is to create a macro to help her. I would like the macro to automatically identify all the blue cells in the workbook and give her a list of these cells. I wonder if someone could give me direction on a couple of things:
1) The command in the macro that would return whether a cell is shaded blue
2) The way in which I could cycle through all the content of each worksheet. I'm thinking worse case I would have to write instructions to go to each sheet, and then do an outer loop to go through each row, and an inner loop for each column (and the number of active cells varies by worksheet) -
View 9 Replies
View Related
Jan 6, 2013
I'm trying to create a formula that can display colors based on the strength of the margin of victory of a candidate, take these two examples for instance.
County
Frank
Cole
Dean
Total
MOV
MOV%
[Code]....
I want to be able to draw in the outline of these counties (or at least the cell proceeding the MOV%) displaying the color that corresponds with the winner of that county. The added twist would be to shade the color depending on the Margin of Victory (MOV) as well. The closer the vote, the lighter (or mixed?) the cell (or county) would be. If it could be at all possible I would really be cool to mix both colors so that a result 100% for one candidate would get a color 100% pure while a 17% MOV would get a color 17% more of the winning candidate than of the loser (or losers) colors. I don't think a VBA is necessary for this one.
View 2 Replies
View Related
Feb 27, 2013
I am trying to format certain cells to change colors depending on the date and the content of the next field to show due dates.
cell label
due date
date completed
c5
au5
be5
c6
au6
be6
c7
au7
be7
c8
au8
be8
What I need is for the contents of au5 to be green up until 10 days before the due date, yellow up until 5 days, and red with less than 5 days until the due date. If the date completed is entered into be5, then the contents of au5 should be black.
Is this possible, and if it is, how do I set this up? I tried to use
=$AU5-TODAY()>=10
And choose green formatting (something I found on yahoo answers), but when I enter the date the text is still the original black font.
View 5 Replies
View Related
Feb 22, 2010
using =ColorFunction to count cells highlighted in different colors.
Is that function available in Excel 2007 under a different function name?
View 9 Replies
View Related
Feb 6, 2014
Like u see in attachment i have products in cells wich are painted in different colors. I need to compare two numbers of different product, and write result to column "Type D,C,B". If one of two products is without color/white or they are not the same color then result is always "D", if both products/cells have same color and different number then results is "C", if the color and number is the same then result is "B"
Below cell B2 I will write numbers by hand, when I finish and start macro it will compare first cell B2 and B3 and write result to C3, then compare B3 and B4 and write result to C4 and do that until there is any number in column B:B.
Attached File : excel help.xlsx‎
View 8 Replies
View Related
Apr 30, 2014
I have some excel sheets that are formatted like the following:
COMPANY | TOTAL | R | G | B
company1 | 10 | 255 | 000 | 000
company2 | 20 | 000 | 255 | 000
company3 | 30 | 000 | 000 | 255
...
and so on...
My question is that I would like to have a macro that runs on this basic file and creates a bar graph with the data. Then it utilizes the RGB values in the columns to change the specific bar for that row. So setting the r, g, b as variables corresponding to the columns in the sheet. Also there isn't a preset number of rows in the files.
[URL]
View 13 Replies
View Related
Jan 3, 2014
How to sort out a way to count cells whose fill colors have been set via conditional formatting.
I'm sure that I was once able to use Chip Pearson's CountOfCF function back in the days of Excel 2003, as it worked around the 3 condition limit and used .ColorIndex which assumed that you'd only ever be formatting using the .ColorIndex values of 1 to 56, but I can't seem to be able to get it to work in 2010.
View 7 Replies
View Related
Mar 20, 2014
I am working on a project where I am virtually almost finished except for a minor change with the pie chart. I am analyzing some data and recorded a macro to do this and also the pie chart for visualization. However, I do not like the color of the default pie chart colors and would like to customize it. How could I change this within the macro I have recorded?
[Code] .....
View 4 Replies
View Related