Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Changing the colour of a bar on a chart

I have created a column chart and am now trying to change the colour of one
of the bars. Here is the code I am using:

With chtChart
ActiveChart.SeriesCollection(1).Points(2).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End With

But to an avail. can anyone see what is wrong with it?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Changing the colour of a bar on a chart

try

ActiveSheet.ChartObjects(1).Activate
With chtChart
ActiveChart.SeriesCollection(1).Points(2).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End With


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Changing the colour of a bar on a chart

That code should work though "With chtChart..End With" does nothing in your
useage.
You don't need to select the chart

With ActiveSheet.ChartObjects(1).Chart
.SeriesCollection(1).Points(2).Interior.ColorIndex = 3
End With

Regards,
Peter T

"Graham Whitehead" wrote in message
...
I have created a column chart and am now trying to change the colour of

one
of the bars. Here is the code I am using:

With chtChart
ActiveChart.SeriesCollection(1).Points(2).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End With

But to an avail. can anyone see what is wrong with it?




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
Changing background colour when changing data in a cell Paoul Excel Discussion (Misc queries) 7 December 26th 08 07:25 AM
Changing all cells in one colour to a different colour Bob Excel Discussion (Misc queries) 3 June 25th 08 02:12 PM
Changing default chart settings like background colour etc synthesizer_patel Setting up and Configuration of Excel 1 December 4th 06 06:11 PM
Permanently changing default chart settings like gridlines and background colour synthesizer_patel Charts and Charting in Excel 0 December 4th 06 02:12 PM
Maintain colour changes in a Pivot Chart when changing Pivot value rdickfos Charts and Charting in Excel 1 April 11th 06 09:05 AM


All times are GMT +1. The time now is 06:07 AM.

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

About Us

"It's about Microsoft Excel"