LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lilbit
 
Posts: n/a
Default Recorded Macro to Copy Format

I have created the following macro which works perfectly:
Sub CreateMnthlySFAReport()
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "MDSummary"
Range("a1, c1, d1, e1, f1, h1, k1, l1, m1, n1, o1, p1, r1, s1, t1,
u1,v1, w1, aa1, ab1, ae1, af1, ag1, ah1, ai1, aj1,
ak1").EntireColumn.Delete
Sheets.Add
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Stage5"
Sheets.Add
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Stage4"
Sheets.Add
Sheets("Sheet3").Select
Sheets("Sheet3").Name = "Stage3"
Application.DisplayAlerts = False
Workbooks.Open Filename:="H:\TRWPDOCS\SFA\SFA Report Format.xls"
Cells.Select
Selection.Copy
Windows("SFA Working Sheets.xls").Activate
ActiveSheet.Paste
Sheets("Stage4").Select
Windows("SFA Report Format.xls").Activate
Sheets("Stage4").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Windows("SFA Working Sheets.xls").Activate
ActiveSheet.Paste
Sheets("Stage5").Select
Windows("SFA Report Format.xls").Activate
Sheets("Stage5").Select
Cells.Select
Application.CutCopyMode = False
Selection.Copy
Windows("SFA Working Sheets.xls").Activate
ActiveSheet.Paste
Range("A1").Select
Windows("SFA Report Format.xls").Activate
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub

I recorded the following macro to copy the page formatting from the
MDSummary worksheet to the others, but I keep getting an error message.
It works perfectly by itself, but I want to incorporate it in the
above-noted macro. I think I'm just not inserting it correctly. Help!!
Thanks!!
Sheets(Array("Stage3", "Stage4", "Stage5", "MDSummary")).Select
Sheets("MDSummary").Activate
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.3)
.RightMargin = Application.InchesToPoints(0.3)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With


 
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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Format Macro Buttons? Ken Excel Discussion (Misc queries) 5 March 2nd 05 08:40 PM
Macro - Copy - Email John Excel Worksheet Functions 1 March 2nd 05 07:36 PM
How do I copy a cell (content AND format) from one worksheet to a. Excel Format Copy Excel Worksheet Functions 1 February 9th 05 10:34 PM


All times are GMT +1. The time now is 04:02 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"