ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy chart area (https://www.excelbanter.com/excel-programming/335983-copy-chart-area.html)

Vik[_3_]

copy chart area
 
Hi All,

I need to make a copy of a template sheet, containing a chart area, which in
turn contains a plot area.
I create a new sheet, rename it, then copy contents of a template as
follows -
Sheets(TemplateSheet).Activate
ActiveSheet.UsedRange.Select
Selection.Copy
With ActiveWorkbook.Sheets
.Add After:=Worksheets(Worksheets.count)
End With
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName
ActiveSheet.Paste
It copies all the spreadsheet, but no plot shows up on a copy.

How can I do that?

Thanks!



Jon Peltier[_9_]

copy chart area
 
Vik -

You're making a new sheet, and copying part of another sheet onto the
blank new sheet. Why not use a copy of the whole sheet instead:

Sheets(TemplateSheet).Copy After:=Worksheets(Worksheets.count)
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Vik wrote:

Hi All,

I need to make a copy of a template sheet, containing a chart area, which in
turn contains a plot area.
I create a new sheet, rename it, then copy contents of a template as
follows -
Sheets(TemplateSheet).Activate
ActiveSheet.UsedRange.Select
Selection.Copy
With ActiveWorkbook.Sheets
.Add After:=Worksheets(Worksheets.count)
End With
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName
ActiveSheet.Paste
It copies all the spreadsheet, but no plot shows up on a copy.

How can I do that?

Thanks!



Vik[_3_]

copy chart area
 
Jon -

Thank you, works great.
Can I ask for one more tip?
How can I give a new name to the chart on a copied sheet?

Thanks,
- Vik

"Jon Peltier" wrote in message
...
Vik -

You're making a new sheet, and copying part of another sheet onto the
blank new sheet. Why not use a copy of the whole sheet instead:

Sheets(TemplateSheet).Copy After:=Worksheets(Worksheets.count)
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Vik wrote:

Hi All,

I need to make a copy of a template sheet, containing a chart area,

which in
turn contains a plot area.
I create a new sheet, rename it, then copy contents of a template as
follows -
Sheets(TemplateSheet).Activate
ActiveSheet.UsedRange.Select
Selection.Copy
With ActiveWorkbook.Sheets
.Add After:=Worksheets(Worksheets.count)
End With
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName
ActiveSheet.Paste
It copies all the spreadsheet, but no plot shows up on a copy.

How can I do that?

Thanks!





Jon Peltier[_9_]

copy chart area
 
Naming a Chart:

http://peltiertech.com/Excel/ChartsH...ameAChart.html

ActiveSheet.ChartObjects(1).Name = "New Chart Name"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Vik wrote:

Jon -

Thank you, works great.
Can I ask for one more tip?
How can I give a new name to the chart on a copied sheet?

Thanks,
- Vik

"Jon Peltier" wrote in message
...

Vik -

You're making a new sheet, and copying part of another sheet onto the
blank new sheet. Why not use a copy of the whole sheet instead:

Sheets(TemplateSheet).Copy After:=Worksheets(Worksheets.count)
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Vik wrote:


Hi All,

I need to make a copy of a template sheet, containing a chart area,


which in

turn contains a plot area.
I create a new sheet, rename it, then copy contents of a template as
follows -
Sheets(TemplateSheet).Activate
ActiveSheet.UsedRange.Select
Selection.Copy
With ActiveWorkbook.Sheets
.Add After:=Worksheets(Worksheets.count)
End With
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName
ActiveSheet.Paste
It copies all the spreadsheet, but no plot shows up on a copy.

How can I do that?

Thanks!






Vik[_3_]

copy chart area
 
Jon,

Perfect site.
I meant changing a caption, which means -

ActiveSheet.ChartObjects(1).Chart.ChartTitle.Capti on = "newname"

But I figured that out with your help.

Thanks!
- Vik

"Jon Peltier" wrote in message
...
Naming a Chart:

http://peltiertech.com/Excel/ChartsH...ameAChart.html

ActiveSheet.ChartObjects(1).Name = "New Chart Name"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Vik wrote:

Jon -

Thank you, works great.
Can I ask for one more tip?
How can I give a new name to the chart on a copied sheet?

Thanks,
- Vik

"Jon Peltier" wrote in message
...

Vik -

You're making a new sheet, and copying part of another sheet onto the
blank new sheet. Why not use a copy of the whole sheet instead:

Sheets(TemplateSheet).Copy After:=Worksheets(Worksheets.count)
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Vik wrote:


Hi All,

I need to make a copy of a template sheet, containing a chart area,


which in

turn contains a plot area.
I create a new sheet, rename it, then copy contents of a template as
follows -
Sheets(TemplateSheet).Activate
ActiveSheet.UsedRange.Select
Selection.Copy
With ActiveWorkbook.Sheets
.Add After:=Worksheets(Worksheets.count)
End With
NewSheetName = "newname"
ActiveSheet.Name = NewSheetName
ActiveSheet.Paste
It copies all the spreadsheet, but no plot shows up on a copy.

How can I do that?

Thanks!









All times are GMT +1. The time now is 09:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com