Hello Excel gurus,
I have a question about a Macro I would like to use, however the macro increases the opening time of the workbook a lot which is kind of annoying.
The macro is as follows:
Is there a solution to make the macro run quicker? Especially with some of the bigger workbooks it will take almost 5 min to complete its cycle.
Thank you very much in advance.
Kind Regards,
Grompey
I have a question about a Macro I would like to use, however the macro increases the opening time of the workbook a lot which is kind of annoying.
The macro is as follows:
VBA Code:
Private Sub Workbook_Open()
Dim sh As Worksheet
For i = 1 To ActiveWorkbook.Sheets.Count
Set sh = ActiveWorkbook.Sheets(i)
With sh.PageSetup
.LeftFooterPicture.FileName = "C:\\MyFile"
.CenterFooter = "&""Tahoma""&10ActiveWorkbook.FullName"
.RightFooter = "&""Tahoma""&10Page &P of &N "
.LeftMargin = Application.CentimetersToPoints(1.5)
.RightMargin = Application.CentimetersToPoints(0.5)
.TopMargin = Application.CentimetersToPoints(1.2)
.BottomMargin = Application.CentimetersToPoints(1.6)
.HeaderMargin = Application.CentimetersToPoints(0.4)
.FooterMargin = Application.CentimetersToPoints(0.8)
End With
Next i
End Sub
Is there a solution to make the macro run quicker? Especially with some of the bigger workbooks it will take almost 5 min to complete its cycle.
Thank you very much in advance.
Kind Regards,
Grompey
Last edited by a moderator: