Set Background In Cell Depending On Another Cell's Background
Jan 15, 2009
In a range of cells (A1..d8) which have background set with multiple colors. Is it possible to set another range of cells (H1..K8) whith the same backgrounds as the other range and so that if one cells background changes the cell in the second range whill also change to that new color?
I'm trying to create a tag with a color border. What I desire is to fill the BLANK cells around the tag, A1:D1 + D1:D19 + A1:D19 + A1:19 in a certain color based on the text value of the cell B11. There are 5 different values, such that if the B11 read Red Sox - the boarder is going to be red, if it reads Houston Astros it will be dark blue, etc..
I have a similar problem with changing the color of the cell based on the month. So regardless of the year, 2014, 2015, 2016, etc... If I use MONTH() function I can just get numbers from 1-12. I want Cell C16-C18 to be certain color depending the date entered in cell C17 such that for each quarter, months 1-3, 4-6, 7-9, 10-12 they are different color.
I have had no luck with conditional formatting (and I also believe that it is good up to 3 cases only). I am decent in logic/programming language but have little knowledge with macro notation and especially how to run them in excel 2013. I do know how to start it alt+F11 and that I need to make sure that code is written under the specific sheet where my tag is located.
I need a macro that will change the background colour of a cell depending on whether it equals a certain variant. Let me explain.
Cells D8 to N8 will either equal 1, 2, 3 or 4. Depending on the value of the cells on row 8 (D8:N8) I need the above cells on row 4 (D4:N4) to have a different background colour.
If the cell on row 8 is 1, the cell on row 4 must have a green background. If the cell on row 8 is 2, the cell on row 4 must have a yellow background. If the cell on row 8 is 3, the cell on row 4 must have a red background. If the cell on row 8 is 4, the cell on row 4 must have a blue background.
Therefore, if D8 = 3, D4 will have a red background. If F8 = 2, F4 will have a yellow background. And so on.
I need a macro that when ran changes the background colour of the cell range D4:N4 depeding on the value of the cell 4 rows beneath (D8:N8).
I am currently using this Formula to Search a table on sheet 2 (Tabelle2) and copy the date in the relevent cell (Cells) into the correct cell on Sheet 1 (Master Sheet).
[Code] ..........
Used in cells E10:AZ30 and E33:AZ46
This works perfectly and is the formula behind all relevent cells in Sheet 1.
I would like to keep this but to add that it also copies the background color of the cell in Sheet 2 to the cell in sheet 1.
If i can Bring this Formula into VBA and add the color changing part, It must only work on the cells listed above..
Excel 2010. I need to place picture into one cell or one big merged cell, as a background fill. picture must resize to size of cell. must be fixed in, not in front. i still need write into that cell, so it needs to be really background.
I am working on a workbook with 200+ sheets and an index linking to each of the sheets. On the sheets there is a cell containing the results of calculations and I need the cell referencing the sheet in the index to change background colors depending if the calculations value is greater or less than 0. I currently have working code that also changes the tab color of each sheet depending on the value, but i am trying to add the index cell background change functionality into that. also, the index listings is subject to change. my working code is
VB:
Private Sub Worksheet_Change(ByVal Target As Range) If Range("d34").Value < 0 Then Me.Tab.ColorIndex = 3 ElseIf Range("D34").Value > 0 Then Me.Tab.ColorIndex = 4 Else
[Code]...
and the code i am trying to get working is
VB:
Private Sub Worksheet_Change(ByVal Target As Range) Dim rngX As Range Set myRange = Worksheets("Index").Range("A1:A500").Find(Range("C2").Text, lookat:=xlPart) ' the C2 is the reference the title that would be on the index If Range("d40").Value < 0 Then
[Code]....
I keep getting the runtime error '1004: application-defined error or object-defined error the thing is, i ran the cell background changing code in a normal macro before integrating it in my other worksheet code first and it worked fine. I have a little code experience, though not much in vba and I am unsure what the issue is. if there is another better way to accomplish what I'm tring to do, that would also be fine.
I am working on developing QR Codes using some MATLAB code and it would be really convenient if I could create an excel program which changed the background color of a cell containing a 1 to black and a cell containing a 0 to white.
when I copy a worksheet from one workbook to another, the colors on the sheet in the destination workbook, become dull/faded. They actually change from the original colors to some off colors. I copy by selecting the source sheet, hold down ctrl key, then drag from one workbook to another). Also, is there a way to get the sheet back to the original colors.
I found this template, it works great, I have customized it to fit my business. One thing I cannot seem to change is the cell background on the shift tab. I am able to change the background but on the schedule tab when I select a shift the background is still the same. Here is the template [URL]
My question is relevant to the one in this thread: ttp://www.excelforum.com/excel-prog...ckgrounds.html. Instead of one cell, as in the above thread I want it for a complete row.
How I can change the background colour of cell C:2 depending on what other cell i click? Below a sample of the code im using Basically when i click B:2 i want C:2 to turn grey with the text on top.... Then when i click B:4 i want C:2 to turn Red.....
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Select Case Target.Address Case Is = "$B$2" Range("D2").Value = "No action needed connector is down" 'change this to suit Case Is = "$B$3"
I would like to identify text cells of my document containing names of speakers in a conference with their nationality. I would like to do that by setting the background of the cell with the national flag of the country where the speaker comes from.
I tried to select the flag as an image and put it over the name with trasparency but then it result very not convenient to modify the text in the cell and the image makes the worksheet very heavy
On one worksheet I have a list of colours in cells. I want to be able to look in the list the list and return the background colour of that cell. The function i am using is:
=CELLCOLORINDEX('1.1'!$C28,FALSE)
'1.1' is the worksheet name, $C28 is the cell (coloured blue)
It seems to work because I am getting the correct background colour in the new worksheet, however it also returns the number(37) as well.
I just want the background colour to be shown only, not the color's number as well.
Function CellColorIndex(InRange As Range, Optional _ OfText As Boolean = False) As Integer ' ' This function returns the ColorIndex value of a the Interior ' (background) of a cell, or, if OfText is true, of the Font in the cell. ' Application.Volatile True If OfText = True Then CellColorIndex = InRange(1, 1).Font.ColorIndex Else CellColorIndex = InRange(1, 1).Interior.ColorIndex End If End Function
how put picture into cell as background. it means, after it's done, if i click on cell, i must be able write into cell like before change. i dont want solution through comments or shapes because picture will be on top of cell. and not as background
When I return to a sheet by clicking on the tab of the sheet, the sheet is not immediately visible. When the sheet does become visible a cell has a black flashing background. Sometimes, but not always, the flashing cell is the activecell. Through the activate event of the sheet I attempt to make $A$1 the active cell:
I'm working on a sheet that gets filled in with background colors (red, light blue, and green) and I'm trying to come up with a way to automate the process of inputting the text in the red and blue fields (red always gets PROCESS and light blue always gets SHPD) but they end up in different locations in the same columns. is there a function or macro to make this happen? I have constructed a macro to compile the sheet from my online database as it is a live system.
MODELACTIONxxx1xxx2xxx3xxx4xxx5xxx6xxx7xxx8xxx9xxx10xxx11xxx12xxx13xxx14xxx15xxx16xxx17 This is a simplified version of what I'm working with, and i'm on Excel 2000
I'm using this code below to change the background colour of a range of cells:
Code: With .Range("I18:J18") .Locked = False .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = 9739376 'RGB(112,156,148) .TintAndShade = 0 .PatternTintAndShade = 0 End With
I am receiving 'Object doesn't support this property or method' errors starting with the highlighted row. I'm unable to understand where I've erred. Note that range I18:J18 are merged.
Is this method an efficient way of simply changing a cell's background colour?
I have an excel spreadsheet that 7 different categories (eg. Ave waittime, Avg loadtime, etc) that I have conditionally formatted based on 5 ratings (each rating a different color Green, light green, yellow, red, and purple) I would like to be able to give each cell a value based on what color it is eg. Green=5, light green=4 and so on.
The problem is that the cells which need to change are locked and have a object group ontop of them and are not all in one row or column..
The cells which need to change are A4,A5,A6,B6,C6,D6,E6,F6,G6,H2,H3,H4,H5,H6,I6,J6,K2,K3,K4,K5,K6.
It sort of a theme changer for my spreadsheet incase people want a change and can do all of it with one click of a button or maybe click on a cell with the colour on it and have that colour copy itself to the range.
I want to change the color of a cell's background based on valid data in the cell. I have a pull-down list, it uses a named list, and this all works fine. I want the cell to be red, and then after the user selects a valid entry from the pull-down list, I want to change the cell to yellow.
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.
I wish for a text box (drawn Text Box, from the "Shapes" tab) to conditionally change its background color based on whether a cell in a different sheet says "Online" - in which case it should be green, or "Offline" - in which case it should be red. So far, the code that I have that doesnt work at all, which I'm not even sure where to place (I tried in the Workbook - Open?), is the following:
[Code] .....
I also need to do this for a total of 9 Text Boxes, if that changes anything.
I need a macro that would change the cell background color in a calendar according to list of dates found in a table (Holidays & Vacations) which can changes on a yearly basis.