Slow Macro on Page Margin Change for all sheets
I haven't tried this on your particular problem, but if you avoid selecting
things macros run a whole lot faster. Why don't you try this:
Application.ScreenUpdating = False
'then all your code, except skip the wks.visible part and just set all the
margins.
TH
On 4/22/04 12:38, in article , "Far"
wrote:
I have a Macro that changes the Print Page Margin on all
worksheets, but it very slow.
Is there a way to speed this up by forcing a calcualtion
of the the Margings at the end of the Macro doing recalc
on all sheets at once?
' Defines standard Footer & Header settings
For Each wks In Worksheets
If wks.Visible = xlSheetVisible Then
wks.PageSetup.LeftMargin =
Application.InchesToPoints(0.21)
wks.PageSetup.RightMargin =
Application.InchesToPoints(0.23)
End If
Next wks
End Sub
Thanks you for the help
|