LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ram Ram is offline
external usenet poster
 
Posts: 138
Default Move / copy worksheet without any changes to the page setup

Hi,

I've got code to copy worksheets as individual files, however, once the code
is executed and i've got individual files, the page setup is not the same as
the original.

code is below

Sub TEST()
Dim NB, MB As Workbook
Set MB = ThisWorkbook
Dim I, II As Long
For I = 1 To MB.Sheets.Count
Set NB = Workbooks.Add
MB.Sheets(I).Cells.Copy NB.Sheets(1).Range("A1")
NB.Sheets(1).Name = MB.Sheets(I).Name
For II = 2 To NB.Sheets.Count
Application.DisplayAlerts = False
NB.Sheets(2).Delete
Application.DisplayAlerts = True
Next
ActiveWindow.DisplayGridlines = False
NB.SaveAs "C:" & MB.Sheets(I).Name & ".xls"
NB.SendMail ", "Split files"
NB.Close
Next
End Sub

Can you help add a code here which will retain the page setup (page
orientation and margins)

Also, instead of sending email, is it possible to just save the emails in
drafts folder?

thanks in advance
 
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
How to copy page setup Robin Chapple New Users to Excel 2 July 30th 06 05:05 PM
Copy Page Setup across tabs JWF Excel Discussion (Misc queries) 1 March 13th 06 04:04 PM
copy page setup from worksheet to another within workbook Fanny Excel Worksheet Functions 2 October 6th 05 02:49 AM
Can I copy a worksheet with its page setup and print formats? MSSAC_QA Excel Discussion (Misc queries) 2 July 14th 05 02:24 PM
How do I copy page setup from one worksheet & paste into new shee. Rasc0 Excel Discussion (Misc queries) 2 December 1st 04 10:12 PM


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

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

About Us

"It's about Microsoft Excel"