Macro
This copies a sheet "02", renames and deletes the button
HTH
Sub CopyWs()
Sheets("02").Copy after:=Sheets(2)
Sheets("02 (2)").Select
Sheets("02 (2)").Name = "03"
ActiveSheet.Shapes("Button 1").Select
Selection.Cut
End Sub
"zephyr" wrote:
Macro as follows:
Range("E14").Select
Sheets("Sheet2").Select
Range("C38:C39").Select
Application.Run "Book1!Button1_Click"
ActiveSheet.Shapes("Button 1").Select
Range("D8").Select
ActiveSheet.Shapes("Button 1").Select
Application.Goto Reference:="Button1_Click"
End Sub
The macro only copies the worksheet but the debug error message come up when
I try to use it. Steps b) to d) cannot be recorded.
Many thanks for your assiatance
"Toppers" wrote:
Post the code.
"zephyr" wrote:
I have a workbook with two worksheets.
Worksheet 01 is the summary
Worksheet 02 is the form template.
I have a form button on Worksheet 02, I have tried to record a macro for the
button that does the following
a) copies the worksheet 02
b) re-names the worksheet as 03
c) places the worksheet after 02
d) removes the command button from the new worksheet 03.
e) When the contents of cell A1 & A2 are typed in on worksheet 03, the
contents also appear in the cells B1 and B2 on the summary Worksheet 01.
I want to use the workbook for multiple worksheets with the summary for each
one appearing on the summary Worksheet 01.
When I remove the command button from worksheet 03 a debug error message
comes up.
Your help is appreciated.
|