Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to change ALL of my chart from a bar graph
to an X-Y or line chart? I have 27 charts on thier on sheet. I want to be able to have a button that runs a macro that will change all the chart to bar, then another to change it back to a line chart? Any thought? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following macros will change all embedded charts on the active sheet:
'======================= Sub ChartsToLine() Dim chObj As ChartObject For Each chObj In ActiveSheet.ChartObjects chObj.Chart.ChartType = xlLine Next End Sub '=================================== Sub ChartsToColumn() Dim chObj As ChartObject For Each chObj In ActiveSheet.ChartObjects chObj.Chart.ChartType = xlColumnClustered Next End Sub '========================== wrote: Is there a way to change ALL of my chart from a bar graph to an X-Y or line chart? I have 27 charts on thier on sheet. I want to be able to have a button that runs a macro that will change all the chart to bar, then another to change it back to a line chart? Any thought? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change the code to the following:
'====================== Sub ChartsToLine() Dim ch As Chart For Each ch In ActiveWorkbook.Charts ch.ChartType = xlLine Next End Sub '================================ Sub ChartsToColumn() Dim ch As Chart For Each ch In ActiveWorkbook.Charts ch.ChartType = xlColumnClustered Next End Sub '=============================== Anonymous wrote: Debra, Thanks for the reply. These charts aren't embedded on a sheet, they are on chart sheets. How will I modify the code for it to work? I tried to change active sheet to activechart, but it did not work. Thanks JD -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to change the pivot chart automaticaly as values in the worksheet change | Excel Worksheet Functions | |||
Change caption of a button | Excel Worksheet Functions | |||
Excel bar chart formatting of bars to change colors as data change | Excel Discussion (Misc queries) | |||
Button to change borders | Excel Discussion (Misc queries) | |||
how to change range for dynamic chart in excel 2000 with button? | Charts and Charting in Excel |