copy worksheet via pushbutton

  • Thread starter Thread starter Jean-Paul De Winter
  • Start date Start date
J

Jean-Paul De Winter

Hi,
I would like to have a pushbutton on the first worksheet that, when
pushed, automatically copies this first worksheet to a new one.
everything should be copied except the pushbutton itself of course...
and the active sheet should still be the first one (so I can continue
clicking the button)
(again), this would save me a lot of "clicking".
Thanks
JP
 
Hi
try something like the following macro:
Sub foo()
Dim wks As Worksheet

Set wks = ActiveSheet
wks.Copy after:=wks
wks.Activate
End Sub
 
Missed a bit Frank.

Dim wks As Worksheet

Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wks = ActiveSheet
wks.Copy after:=wks
ActiveSheet.Shapes("Button 1").Delete
wks.Activate
Application.DisplayAlerts = True
Application.ScreenUpdating = True

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top