J
Jan Kåre
Hi!
Excel 2000: Have some 50 identical tables on different sheets
(Table_1 ..Table_50). Trying to make a macro that creates same type of pie
chart for each. Unable to make one work across sheets.
Anyone know a way ? (Pasting in my recorded one below)
Search and replace the name "Table_1" before each run works, but...
New to macros. Please help.
//
Sub Make_pie_cht()
Range("A55,A22").Select
Range("A2").Activate
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData
Source:=Sheets("Table_1").Range("A22,A55"), _
PlotBy:=xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:="Table_1"
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowLabelAndPercent,
LegendKey _
:=False, HasLeaderLines:=True
End Sub
//
Excel 2000: Have some 50 identical tables on different sheets
(Table_1 ..Table_50). Trying to make a macro that creates same type of pie
chart for each. Unable to make one work across sheets.
Anyone know a way ? (Pasting in my recorded one below)
Search and replace the name "Table_1" before each run works, but...
New to macros. Please help.
//
Sub Make_pie_cht()
Range("A55,A22").Select
Range("A2").Activate
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData
Source:=Sheets("Table_1").Range("A22,A55"), _
PlotBy:=xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:="Table_1"
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowLabelAndPercent,
LegendKey _
:=False, HasLeaderLines:=True
End Sub
//