J
John McCoon
greetings.
i'm trying to write a vba to that is commandbutton click
event driven.
Simple task: copy two charts and pasting them in a newly
added sheet.
using Sheets.add procedure excel adds a sheet and
incrementally attaches a number to the name. first time
one clicks the command, say, sheet1 is inserted, next time
is sheet2 etc.
The problem I have is that I need to track which is the
latest sheet# that was added.
How do I do that?
Private Sub commandbutton1_click()
ActiveSheet.ChartObjects("Chart 735").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Sheets.Add
'this will add a sheet#
Sheet#.select
activesheet.paste
I don't want to use activesheet.paste because I need to
refer to this newly added sheet later in this same
subroutine.
Thanks
John
i'm trying to write a vba to that is commandbutton click
event driven.
Simple task: copy two charts and pasting them in a newly
added sheet.
using Sheets.add procedure excel adds a sheet and
incrementally attaches a number to the name. first time
one clicks the command, say, sheet1 is inserted, next time
is sheet2 etc.
The problem I have is that I need to track which is the
latest sheet# that was added.
How do I do that?
Private Sub commandbutton1_click()
ActiveSheet.ChartObjects("Chart 735").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Sheets.Add
'this will add a sheet#
Sheet#.select
activesheet.paste
I don't want to use activesheet.paste because I need to
refer to this newly added sheet later in this same
subroutine.
Thanks
John