Attribute VB_Name = "V01_Recording" Option Explicit ' ------------------------------------------------------------------ ' What the Macro Recorder wrote when we set the page to landscape, ' one page wide by one page tall (recorded on a machine with A4 paper). ' Two settings changed, the whole PageSetup object recorded. ' ------------------------------------------------------------------ Sub Page_Setup_Recorded() With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.708661417322835) .RightMargin = Application.InchesToPoints(0.708661417322835) .TopMargin = Application.InchesToPoints(0.748031496062992) .BottomMargin = Application.InchesToPoints(0.748031496062992) .HeaderMargin = Application.InchesToPoints(0.31496062992126) .FooterMargin = Application.InchesToPoints(0.31496062992126) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .ScaleWithDocHeaderFooter = True .AlignMarginsHeaderFooter = True End With End Sub ' ------------------------------------------------------------------ ' The same result in four lines: only the settings we actually changed. ' ------------------------------------------------------------------ Sub Page_Setup() With ActiveSheet.PageSetup .Orientation = xlLandscape .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With End Sub ' ------------------------------------------------------------------ ' A recorded formatting macro, tidied up: bold white header on dark ' grey, number format on the price columns, columns autofitted. ' Works on the active sheet, whatever its number of rows. ' ------------------------------------------------------------------ Sub Format_Price_Report() With ActiveSheet.Range("A1").CurrentRegion .Rows(1).Font.Bold = True .Rows(1).Font.Color = RGB(255, 255, 255) .Rows(1).Interior.Color = RGB(69, 69, 69) .Columns(5).NumberFormat = "#,##0.00" .Columns(6).NumberFormat = "#,##0.00" .Columns.AutoFit End With End Sub