![]() |
change colorIndex, help me write an easy macro
Could someone please help me write a macro that changes the colorIndex of a
cell based on it's value. I want all positive numbers in my selection to be green and all negative numbers to be red... this should be easy but I need help! Thanks, Matt |
change colorIndex, help me write an easy macro
Hi Matt,
Try using conditional formatting: Data | Conditional formatting... Condition1 Formula is: =A1=0 Format | select a green pattern Condition 2 Condition1 Formula is: =A1<0 Format | select a red pattern --- Regards, Norman "Matt_70501" wrote in message ... Could someone please help me write a macro that changes the colorIndex of a cell based on it's value. I want all positive numbers in my selection to be green and all negative numbers to be red... this should be easy but I need help! Thanks, Matt |
change colorIndex, help me write an easy macro
Or use a custom cell format
0.00;[Red]-0.00 -- Regards Ron de Bruin http://www.rondebruin.nl "Norman Jones" wrote in message ... Hi Matt, Try using conditional formatting: Data | Conditional formatting... Condition1 Formula is: =A1=0 Format | select a green pattern Condition 2 Condition1 Formula is: =A1<0 Format | select a red pattern --- Regards, Norman "Matt_70501" wrote in message ... Could someone please help me write a macro that changes the colorIndex of a cell based on it's value. I want all positive numbers in my selection to be green and all negative numbers to be red... this should be easy but I need help! Thanks, Matt |
change colorIndex, help me write an easy macro
Hi, Best doing this with conditional formatting, choose your cell select Formats, Conditional Formatting then click the drop down box next to Cell Is and select Formula is, assuming you are using Cell A1 type in the box =A10 then choose formats, patterns and then select your colour, now click add do the same as above only this time type =A1<0 and choose formats, patterns and your colour, then copy the cell over as many as you like. Hope this helps! regards, Simon -- Simon Lloyd ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708 View this thread: http://www.excelforum.com/showthread...hreadid=546296 |
change colorIndex, help me write an easy macro
Sorry, I miss the color
green -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... Or use a custom cell format 0.00;[Red]-0.00 -- Regards Ron de Bruin http://www.rondebruin.nl "Norman Jones" wrote in message ... Hi Matt, Try using conditional formatting: Data | Conditional formatting... Condition1 Formula is: =A1=0 Format | select a green pattern Condition 2 Condition1 Formula is: =A1<0 Format | select a red pattern --- Regards, Norman "Matt_70501" wrote in message ... Could someone please help me write a macro that changes the colorIndex of a cell based on it's value. I want all positive numbers in my selection to be green and all negative numbers to be red... this should be easy but I need help! Thanks, Matt |
All times are GMT +1. The time now is 10:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com