I would like to auto-format a spreadsheet with a specific conditions. On process completion, the sheet row should be auto-formatted (i.e alternate rows have same cell background color) and the header row, usually Row 1, with different color and font bold.
NOTE: THIS NEEDS TO BE DONE BY VBA CODE.
Also note, formatting needs to be done for "n" rows which have data, leaving the rest blank.
My pagelayout Code,
Public Function SetPageLayout(pworksheet)
'Set the page layout of the worksheet to be landscape and format to fit1 page
With Sheets(pworksheet).PageSetup
.PaperSize = xlPaperA4
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.LeftMargin = Application.CentimetersToPoints(1)
.RightMargin = Application.CentimetersToPoints(1)
.TopMargin = Application.CentimetersToPoints(1)
.BottomMargin = Application.CentimetersToPoints(1)
End With
End Function