folks,
I have a workbook which processes multiple csv files and produces multiple worksheets based on the csv information. Depending on the dates selected by the user, many worksheets (30 - 50) may be produced. each of these worksheets is then formatted prior to exporting the sheets to a pdf file. The code i use to format the worksheets is below, but it runs incredibly slow, so the whole process can take upwards of 30 minutes. Does anyone know of a better or faster way of carrying out the formatting of each sheet?
Any help much appreciated.
Sub sheet_format()
With ActiveSheet.PageSetup
.RightFooter = "Page &P of &N"
.PrintTitleRows = "$1:$9"
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.4)
.RightMargin = Application.InchesToPoints(0.4)
.TopMargin = Application.InchesToPoints(0.4)
.BottomMargin = Application.InchesToPoints(0.4)
.CenterHorizontally = True
End With
End Sub
I have a workbook which processes multiple csv files and produces multiple worksheets based on the csv information. Depending on the dates selected by the user, many worksheets (30 - 50) may be produced. each of these worksheets is then formatted prior to exporting the sheets to a pdf file. The code i use to format the worksheets is below, but it runs incredibly slow, so the whole process can take upwards of 30 minutes. Does anyone know of a better or faster way of carrying out the formatting of each sheet?
Any help much appreciated.
Sub sheet_format()
With ActiveSheet.PageSetup
.RightFooter = "Page &P of &N"
.PrintTitleRows = "$1:$9"
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.4)
.RightMargin = Application.InchesToPoints(0.4)
.TopMargin = Application.InchesToPoints(0.4)
.BottomMargin = Application.InchesToPoints(0.4)
.CenterHorizontally = True
End With
End Sub