Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i write a macro to change font color with live data? CJS Excel Programming 1 May 26th 06 06:28 PM
Trying to change ColorIndex for series settings SiriS Charts and Charting in Excel 3 March 14th 06 01:54 PM
ColorIndex and Caps Change too slow [email protected] Excel Programming 6 October 13th 05 01:28 PM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
change font of certain cells in row(s) when ColorIndex of Column S changes KAS Excel Programming 4 March 24th 05 04:45 PM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"