Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Creating identical print layout from copied worksheet

Currently running the following macro to save multiple worksheets from
workbook "Jobs" to a new workbook with the name in cell E1 of original Jobs
worksheet "Concrete".
Because I am copying cells A:E into the first new worksheet within the new
workbook I then need to make sure that the print layout is identical - ie the
1st worksheet in the new workbook needs to be set to fit to one page (as per
"Concrete" worksheet is setup - just not sure where to insert code

Thanks

Sub savejobC()
' Macro recorded 23/05/2009 by Chris
'

Dim strName As String
Dim strPath As String
Dim strFolder As String
Dim wbTemp As Workbook
Dim varSheets As Variant

varSheets = Array("SubCon C", "Inv C", "Sub C", "Safety C", "Work Method C")
Sheets("CONCRETE").Select
Columns("A:E").Copy
Set wbTemp = Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False
Workbooks("Jobs Workbook.xls").Sheets(varSheets).Copy _
After:=wbTemp.Worksheets(1)
wbTemp.Activate
Sheets("Sheet1").Select
strName = Left(Trim(Range("E1")), 3)
strPath = "c:\Jobs\"
If Dir(strPath & strName, vbDirectory) = "" Then
MkDir "c:\jobs\" & strName
End If
ActiveSheet.Name = Trim(Range("E1"))
For Each sh In ActiveWorkbook.Sheets
sh.Activate
Cells.Copy
Cells.PasteSpecial Paste:=xlPasteValues
Next sh
Range("A1").Select
Sheets("Safety C").Select
Range("A1").Select
Sheets("Sub C").Select
Range("D9").Select
Sheets("Inv C").Select
Range("E13").Select
Sheets("SubCon C").Select
Range("B6").Select
Sheets(1).Select
Range("E1").Select
ActiveWorkbook.SaveAs "c:\jobs\" & strName & "\" & Trim(Range("E1")) & ".xls"
ActiveWorkbook.Close True
End Sub

Reply
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 can I set some cells to not print w/o changing print layout? HMS Excel Discussion (Misc queries) 1 January 9th 09 04:44 PM
Print layout capt Excel Discussion (Misc queries) 9 February 5th 08 03:02 PM
First page of Excel sheerepeats in print layout or print preview philfrotonda Excel Discussion (Misc queries) 1 July 12th 07 09:28 PM
Can view file in print preview, but not print layout.... kkaden Excel Discussion (Misc queries) 1 March 22nd 06 05:54 PM
Creating New Worksheets for identical cells bhussey Excel Programming 2 February 7th 06 01:42 AM


All times are GMT +1. The time now is 10:21 PM.

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"