PC Review


Reply
Thread Tools Rate Thread

Macro to Copy & Paste a Excel file

 
 
DNKMCA
Guest
Posts: n/a
 
      4th Oct 2005
Hi,

Is it possible to create a macro that selects all sheets in an excel file
and paste it into new excel with sheet name.

-DNK


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      4th Oct 2005
It's possible, but you could just save that workbook as a new name.

If you look at:
application.savecopyas
in vba's help, you'll see more info.

But if you want...

Option Explicit
Sub testme()

ActiveWorkbook.Sheets.Copy 'to new workbook
'now the new workbook is active
ActiveWorkbook.SaveAs Filename:="c:\newfile.xls", _
FileFormat:=xlWorkbookNormal

End Sub

There is a difference between these two--you'll notice if you have code in
userforms/class modules/general modules.

DNKMCA wrote:
>
> Hi,
>
> Is it possible to create a macro that selects all sheets in an excel file
> and paste it into new excel with sheet name.
>
> -DNK


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy and paste values (columns)I have a macro file built C02C04 Microsoft Excel Programming 2 2nd May 2008 02:51 PM
Copy data from an HTML file and paste into excel using a macro =?Utf-8?B?S2FybCBT?= Microsoft Excel Programming 1 18th Mar 2007 08:51 PM
Excel Macro to Copy & Paste prometheus_au@excite.com.au Microsoft Excel Worksheet Functions 0 1st Dec 2005 02:56 PM
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Microsoft Excel Programming 1 17th Oct 2005 09:56 AM
Copy and paste from ie to excel using macro =?Utf-8?B?TGFycnkgU2FydG9yaXM=?= Microsoft Excel Programming 3 15th Aug 2005 07:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 AM.