Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Macro on one Worksheet to Work on Others
The following macro to makes a chart from Sheet foo in a workbook that has 20 Worksheets. Each worksheet is identical with regard to the data, hence the Range command always works.
Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("foo").Range("B3:B508,E3:E508"), _ PlotBy:=xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:="foo" ActiveChart.HasLegend = False What needs to be done to make this work on all the worksheets in the Workbook. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Macro on one Worksheet to Work on Others
If the sheet to be worked on is the activesheet
Dim sName as String Dim sh as Worksheet sName = Activesheet.Name set sh = activesheet Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=sh.Range("B3:B508,E3:E508"), _ PlotBy:=xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:=sName ActiveChart.HasLegend = False -- Regards "Tom Dunlap" wrote in message ... The following macro to makes a chart from Sheet foo in a workbook that has 20 Worksheets. Each worksheet is identical with regard to the data, hence the Range command always works. Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("foo").Range("B3:B508,E3:E508"), _ PlotBy:=xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:="foo" ActiveChart.HasLegend = False What needs to be done to make this work on all the worksheets in the Workbook. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Link one worksheet in a workbook to another worksheet in same work | Excel Discussion (Misc queries) | |||
Macro to update a column in a work based on another work sheet | New Users to Excel | |||
Retrieving data into worksheet from another worksheet in same work | Excel Discussion (Misc queries) | |||
Copying the active worksheet to another worksheet in the same work | Excel Worksheet Functions | |||
having a macro work only on a worksheet | Excel Programming |