Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Excel > Excel

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-24-2006, 01:25 PM
Novice
 
Join Date: Feb 2006
Posts: 1
hzrvkt
Default Help with a macro to shade a selected pie chart

I have a simple spreadsheet that we use at work to update training records. The sheet has a pie chart with four quadrants beside each name and four command buttons on the screen. I want to be able to select the pie chart I want to update, then click command button 1 to shade one quadrant, command button 2 to shade the second quadrant, etc. I can figure out how to do one chart but I don't know how to run my shading macro on the active chart that I have selected. Can anyone help?

This one works but only for one chart Not the one that is selected:




ActiveSheet.ChartObjects("Chart 9").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(1).Select
With Selection.Border
.ColorIndex = 48
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Shadow = False
With Selection.Interior
.ColorIndex = 56
.Pattern = xlSolid
End With
ActiveWindow.Visible = False
Windows("Flex Chart Plan Maint.xls").Activate
Range("C3").Select
End Sub

This is what I tried to come up with for the Active Chart:

ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(4).Select
With Selection.Border
.ColorIndex = 48
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Shadow = False
With Selection.Interior
.ColorIndex = 1
.Pattern = xlSolid
End With
End Sub

I get a runtime error'1004'
Select method of Series Class Failed
When I go into debug it takes me to the first line! Help!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gantt Chart: MS Project vs. Excel Nance Project 2 12-09-2008 01:59 PM
Macro Issue Basanth Excel 1 12-05-2008 08:07 PM
Don't count 0 in a chart Rmaisone Excel 0 08-21-2006 12:26 PM
One bar chart for 3 sets of data rclloyd Excel 1 02-03-2006 09:51 AM
Page breaks inserted in Gantt chart have no effect Steve Sells Project 2 11-09-2005 08:12 PM


All times are GMT -7. The time now is 01:57 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft