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
I've tried using "ActiveRange" in lieu of "ActiveCell" as well as other commands that would seem to be correct but have failed.
I have attached an example file.. Basically I want the text in a range to change to red if one cell="Description".
Also, I want a cell's text to turn blue if it's corresponding data in the row says "Click on Title to Follow Link"
The example file explains it a lot better..
Thanks for the help.. Sorry if this may seem like a duplicate post but I was not able to get any of the examples I searched for to work that others have posted.. Also, maybe conditional formatting would be an option here but I could not get it to work as it will only meet the first condition that comes across thats true...
Cells C7:F7 are currently shaded light green. Cells G7:L7 are shaded light blue. M7 is shaded dark blue. N7:Q7 are shaded light yellow and R7:T7 are shaded light gray.
When any cell in that range (C7:T7) is clicked (selected), I want the cell color to change to it's normal color; like light yellow to yellow, light blue to blue, dark blue to blue, light green to green and finally light gray to gray.
These cells represent headings for a database. When a heading is selected, the database will sort by that column and the header will change colors. I can do the sort code.
If another header is chosen, the previous selection will need to revert back to it's lighter color and the new selection will change as above... so only ONE cell will be changed from it's "normal state" color at a time. This will serve as an indicator as to which column is being used for the sort. To the user, it will have the appearance of switching on and off.
If any other cell on the sheet is selected, then this should not trigger an event change.
I have a spreadsheet containing many rows of data that I need people to review. After reviewing the data in the column, a reviewer must enter comments in the right-most column and then hit the Enter key to move to the next row down.
What I'd like to happen -- As a reviewer selects the cell where they need to enter data, I want the entire row to highlight. I can use conditional formatting to change the color of the row once data is entered, but I want to change the color of the row when a specific cell is selected. I've attached a sample spreadsheet.
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 am using this code to hide or unhide rows of text on another sheet:
VB: Sub ProcessSheet1ChangeOnCellJ7(ByVal Target As Range)
Dim sAddress As String Dim sValue As String
'Get the address of the cell that changed without '$' signs sAddress = Target.Address(False, False)
When the "Not Pursuing" list box option is selected (in cell "J7" or "J8" in Sheet 1) I need to add (or over-write) "Not Pursuing" to the range of cells in column "B" (in the "Tasks" sheet), but only for that particular Goal, meaning a limited range of cells in column "B". If the "Pursuing - Show All Tasks" option is selected for a Goal then these same cells need to be blank so that the appropriate person can enter their name into the cell.
The purpose for adding "Not Pursuing" automatically to these yellow highlighted cells is that it will facilitate filtering of tasks by individual in the "Tasks" sheet..
Again I have tried several times to upload a sample file and am unable to, which I know makes it more difficult to solve. (Is there some common mistake people make? I know it's an allowed format and is very small in file size....)
Code solution can be entered directly beneath:
VB: If Target.Value = "Not Pursuing" Then ActiveWorkbook.Sheets("Tasks").Rows("29:29").EntireRow.Hidden = False ActiveWorkbook.Sheets("Tasks").Rows("30:48").EntireRow.Hidden = True
When you are on a spreadsheet and you use the arrow keys on the keyboard to move from one cell to another and you can see the cell you are on because of the lines, is there a way to have the color of those lines a different color than black? I would like to be able to arrow from one cell to another and have the lines be red or green so that I can see easier which cell I am actually on. Sometimes it can be hard to see which cell you are. Even if I could make those lines bolder to show up clearer which cell I am on.
Looking for a Private Sub Worksheet_Change(ByVal Target As Range) code to concatenate cell J, K, E and F cells when both J6 and K6 are selected. The cells start in J6 and K6. When both J6 and K6 are selected, I would like a VBA code to concatenate J6, K6, E6 and F6 in cell L6
(Here is the formula =IF(OR(J6="",K6=""),"",I6&" "&J6 &" "&K6&" - "&E6&" "&" "&F6 I have but looking for a VBA code to accomplish task).
When either J6 or K6 is selected, the code should not concatenate until both cells (J and K) are selected. I would also like a Clear Contents function to clear L6 (or L7, L100, L80 or L13) contents when either J or K cell is deleted. For example, if K value is deleted, the Clear Contents should clean J and L cells contents.
Function BG(InRange As Range) Range("InRange").Select With Selection.Interior .ColorIndex = 6 .Pattern = xlSolid End With End Function
That so far but not quite sure why that isnt working. I want to change the fill color with a UDF that all they do is select a Range and it changes those fill colors to whatever the Colorindex may be. I didnt find anything while searching the forums with this already.
I have a spreadsheet that contains the 5 digit numbers in the rows and the columns respecstively. I'd like a formular or macro to change font color for each cell. If the combined value of the 5 rows are greater or less than the combined range 87030 and 87200, the 5 cells will be changed to Red. If:.........
I have this code that works fine until I password the sheet and the range (b9:d65536) is protected. When I protect the sheet and make a change I get a debug error. What would I need to add/change to handle protected cells on a protected sheet?
VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes" ....
Is it possibe to change another cells color (Fill) based on what is placed in that cell? Example: A1 =if there is an "x" in A2 highlight A1 Green, but I have information in A1 also. Or if I had a different cell say= if there is an X in A1 Highlight A1 Green ect.. This key is to highlight a cell that I have information in based on a different cell having an X in it. If ther eis no X in the cell I have indicated, nothing needs to happen.
When the sum of B7-D7 is less than cell (I7) I would like to change the shade of B7-D7 to orange to indicate that larger values need to be entered to equal the value of cell I7. And when the sum of these three cells does equal I7 their color should change to green. I recorded two macros to change the colors and I've run them to verify they work. But I've got something off in my simple macro below.
Macro is not working .So the macro I am using is supposed to look back at all the months tab, match the Name from previous tabs and if they match change background color of the active sheet's cell to red.
Right now the macro is only able to lookup the name in the previous tab (i.e. For December it will only lookup November tab and not October-January).
e.g. (Candidate name is Jack King and he is in (october's tab, Column A Cell 2 )
I want this candidate name to turn red once I type his name in November/December tab.