LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Creating WBooks

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a new key kate Excel Discussion (Misc queries) 1 August 28th 09 10:48 AM
Creating an add-in HSalim[MVP] Excel Programming 22 December 29th 05 09:54 PM
Creating ActualSelf Excel Discussion (Misc queries) 1 October 20th 05 08:03 PM
show list of wbooks present into a dir sal21[_74_] Excel Programming 1 September 22nd 05 01:02 AM
Help with creating a VBA paritoshmehta[_2_] Excel Programming 7 March 6th 04 01:21 PM


All times are GMT +1. The time now is 08:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"