MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Setting PageSetup properties is very slow...

Posted by Olivier on January 11, 2001 8:31 AM


When I set all the PageSetup properties in a VBA Macro, this takes a very long time to proceed each property.
I am working with Excel 97 SR-2 under Windows 95.

If someone could help, I will appreciate.



Posted by Celia on January 11, 2001 6:54 PM

It's much quicker to use XL4 macro language to do this. For example, to set a header & footer :-
Application.ExecuteExcel4Macro ("PAGE.SETUP(""&C Heading"",""Page &P"")")

Download MACROFUN.EXE to find out the XL4 macro syntax to fit your requirements. Can be downloaded from :-


Posted by Doug Stubbs on January 22, 2001 2:28 PM

Re: Variable name in Custom Header?

I felt as though my question related this so i hope someone will help me answer it.
How can i set a header with the variable name "locationname$" and the text "MTD" in the header so that it will look like "Location MTD". If you have any suggestions please let me know. Thanks!

Posted by Celia on January 23, 2001 2:14 AM

Re: Variable name in Custom Header?

Try this :-

Dim locationname$
locationname = "Location"
ActiveSheet.PageSetup.CenterHeader = locationname & " MTD"