G
Geoff
Hi
From a cmdbutton on a form I am simply trying to create a new workbook and
copy a sheet (not necessarily sheet1) from original to new sheet1 (always).
What happens is that 2 wbooks are created - the first is blank, the second
with the required sheet copied. Why is this and how should my code be
amended?
The code is:
Private Sub cmdExecute_Click()
If chkConfirm = True Then
cFilename = ThisWorkbook.Name
Workbooks.Add
Workbooks(cFilename).Sheets(1).Copy
ThisWorkbook.Sheets(1).Paste
End If
End Sub
i would appreciate any advice. T.I.A
Geoff
From a cmdbutton on a form I am simply trying to create a new workbook and
copy a sheet (not necessarily sheet1) from original to new sheet1 (always).
What happens is that 2 wbooks are created - the first is blank, the second
with the required sheet copied. Why is this and how should my code be
amended?
The code is:
Private Sub cmdExecute_Click()
If chkConfirm = True Then
cFilename = ThisWorkbook.Name
Workbooks.Add
Workbooks(cFilename).Sheets(1).Copy
ThisWorkbook.Sheets(1).Paste
End If
End Sub
i would appreciate any advice. T.I.A
Geoff