adding chart after the last sheet

  • Thread starter Thread starter R.VENKATARAMAN
  • Start date Start date
R

R.VENKATARAMAN

if I have a code statement
ActiveWorkbook.Charts.Add before:=Worksheets(Worksheets.Count)
a chart sheet is added as the penultimate sheet.

even if I replace the term <before> by <after>, the chart is added only as
the penultmate sheet and NOT as the last sheet.

why?
 
I never noticed that. A worksheet is added at the end, as expected.

You could use a two-step approach:

activeworkbook.Charts.Add
activechart.Move _
After:=activeworkbook.Sheets(activeworkbook.Sheets.Count)

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