Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I modify the color of a cell?
I am an Excel beginner, but learning a lot from the experts in this newsgroup. My problem is simple - I have two cells that I am monitoring. If cell 2 is larger in value than cell 1 (a1 < a2), then I need to "highlight" the the cell next to them in Red. If the A1 < A2 condition exists, I call a UserForm and will change the background color of that 3rd cell via an offset in the Userform. What I don't know how to do is change the background color. I would appreciate any help that can be offered. Thank you
JP |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I modify the color of a cell?
James,
Not sure how you will call the userform when A2A1, but to set a cell's colour, just use Range("A3").Interior.ColorIndex = 8 To see all of the standard colours, look up 'Colorindex Property' in VBA Help. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "James Prontier" wrote in message ... I am an Excel beginner, but learning a lot from the experts in this newsgroup. My problem is simple - I have two cells that I am monitoring. If cell 2 is larger in value than cell 1 (a1 < a2), then I need to "highlight" the the cell next to them in Red. If the A1 < A2 condition exists, I call a UserForm and will change the background color of that 3rd cell via an offset in the Userform. What I don't know how to do is change the background color. I would appreciate any help that can be offered. Thank you. JP |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I modify the color of a cell?
Possibly this is what you are looking for.
Range("A1").Select With Selection.Interior ..ColorIndex = 3 ..Pattern = xlSolid End With --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I modify the color of a cell?
You might also want to check out Conditional Formatting for that part as opposed
to VBA. Might be a better option. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "James Prontier" wrote in message ... I am an Excel beginner, but learning a lot from the experts in this newsgroup. My problem is simple - I have two cells that I am monitoring. If cell 2 is larger in value than cell 1 (a1 < a2), then I need to "highlight" the the cell next to them in Red. If the A1 < A2 condition exists, I call a UserForm and will change the background color of that 3rd cell via an offset in the Userform. What I don't know how to do is change the background color. I would appreciate any help that can be offered. Thank you. JP --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I override conditional format to modify color of 1 cell? | Excel Discussion (Misc queries) | |||
modify a standard color like in 2003 | Excel Discussion (Misc queries) | |||
How can you modify the background color of a cell by using formul. | Excel Worksheet Functions | |||
Can I modify cell attributes (font,color etc.) based on function . | Excel Discussion (Misc queries) | |||
Macro to Modify Pivot Table for Color and Bold | Excel Worksheet Functions |