LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing chart colours using VBA


This code does the trick for me (it is from an earlier posting). Just
select the chart before you run the code.

Sub ColorColumns()

Dim vntValues As Variant
Dim intSeries As Integer
Dim intPoint As Integer

With ActiveChart
For intSeries = 1 To .SeriesCollection.Count
With .SeriesCollection(intSeries)
vntValues = .Values
For intPoint = 1 To .Points.Count
If vntValues(intPoint) < 1 Then
' red column
..Points(intPoint).Interior.Color = _
RGB(255, 0, 0)
ElseIf vntValues(intPoint) 0 Then
' green column
..Points(intPoint).Interior.Color = _
RGB(0, 255, 0)
End If
Next
End With
Next
End With

End Sub


--
czywrg
------------------------------------------------------------------------
czywrg's Profile: http://www.excelforum.com/member.php...o&userid=31051
View this thread: http://www.excelforum.com/showthread...hreadid=509752

 
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
Changing Tab Colours BOXMAN Excel Worksheet Functions 2 August 24th 06 01:59 AM
Changing colours in chart witzman Charts and Charting in Excel 2 May 31st 05 06:58 AM
multiple or changing colours in a data table on an excel chart fo. Kerri Buxton Charts and Charting in Excel 2 December 23rd 04 07:39 PM
changing colours on stacked bar chart sphenisc Excel Programming 1 June 10th 04 03:32 AM
Changing Colours on Worksheet Jahson Excel Programming 3 May 20th 04 12:54 PM


All times are GMT +1. The time now is 02:25 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"