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,
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,
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.
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.
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
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.
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.
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...
I have 2 different worksheets...each of them containing item numbers. On Sheet1, Column A contains the item numbers. I have conditional formatting to change the interior color of column A based on several criteria.
On Sheet2, I also have item numbers, but they are located in Column B. If item 12345 in Column A on Sheet1 has an interior color of yellow, I would like that same item on Sheet2 to have an interior color of yellow.
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.
I am in the process of reformatting an excel workbook to act as a review tool for different factors in a process. Part of my redesign includes the use of coding that creates different cell colors based upon the cell contents. The new workbooks will be used to handle existing data for this year. I have developed a process macro to open an existing workbook and copy and transfer the original data worksheet into the newly formatted workbook. The data gets transferred to the new worksheet and the resulting workbook is renamed and saved, Heres'' the rub... the newly saved workbook is missing all of the coding for the worksheets... apparently this is a MS bug.
Has anyone figured a workaround for this. One thought I had is to open both( new and old )workbooks and rather than move/copy , i would transfer the data using cell references.
I have a data base in which I classify cells in three colors (green, yellow, and red) on my own. I would like the first cell in each column to indicate if there is a red or yellow cell in it's column. Because red cells are more important then yellow cells, if there is a yellow and a red cell in the column, I would like the red to over ride the yellow and the first cell would indicate red.
So basically, if there is a red cell in the column, no matter what other colors there are, the first cell should show red. If there is only yellow or yellow and green cells, the first cell should show yellow. If there are only green cells or green cells and clear, the first cell should show clear.
This may have been answered on here but can not seem to find it. My situation is I have values in A1,A2 & A3 that are like counter reading so the value is always changing. What I am looking to do is change the cell color if one of the values is over 500 from the other two values. Say A1 is 3000, A2 is 3250 and A3 is 3500. I would like the cell for A3 to change color.
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.
In Sheet1 cells A1-BW46 (3450 cells), using 9 different colors to fill all the cells.
In Sheet3, starting in A2, I have a plain text list of 3450 cell ranges "A1", "A2", "A3" etc covering all 3450 cells in Sheet1.
I want to populate next to this list the interior color value of the corresponding cell. So in cell A2, I will have the text "A1", in cell B2 I would have either a numerical or text value giving me the color that A1 in sheet1 is filled with.
The script doesn't have to auto update, I will run manually when neededI don't need any manipulation, only the value of the color, and that can be hex, rgb.
I can't upload the actual sheet I'm working with, but if my description of the problem is lacking, I may be able to create a sample sheet to give the idea.
I'm trying to write a routine that will display the Red, Green and Blue RGB properties of a cell's interior colour.
I found the following function:
Function SingleColorFromRGB(colorWanted As String, RGBValue As Long) As Long Dim rColor As Long, gColor As Long, bColor As Long If RGBValue < 0 Then GoTo ReturnError rColor = RGBValue Mod 256 RGBValue = Int(RGBValue / 256) gColor = RGBValue Mod 256
How I should call this function in a worksheet, or failing that, come up with something better e.g. a message box that will display the numeric values of each RGB property for the selected cell, or a single cell worksheet name?
I have a userform which stores the backcolour value of some labels in a spreadsheet so that it can be recalled dependent on what month a user selects. The trouble is that in a spreadsheet, I want to use these backcolor values to colour the interior of a cell. However, the values don't seem to be liked by VBA and I get a 'subscript out of range' when I try to match:
This error comes up against values 65535 and -2147483633
What am I doing wrong? what would be the best way to store a backcolor value in one cell so that it can be used for a cell interior colour?
i am pretty good with VBA after reading a lot of information on the internet but i have a problem i cannot solve:
I have two workbooks with the same sheet names and I am trying to transfer the interior colour of cells from one workbook to the other...
this is the code i came up so far but it doesn't work
With Application.Workbooks(WB1).Worksheets For Each ws In Application.Workbooks(WB2).Worksheets On Error Resume Next For Each cl In ws.UsedRange WB1.ws.cl.Interior.ColorIndex = WB2.ws.cl.Interior.ColorIndex Next cl