PDA

View Full Version : XLM Page Setup



Djblois
02-21-2007, 08:10 AM
I am using the XLM page setup to add headers. However I want to add formating to it as well. Here is the code I am using:

ExecuteExcel4Macro "Page.setup(""&LAtalanta &CSales Detail"")"

How can I add bold and font size to that code. Also, How do I use that code to add footers.

Brandtrock
02-21-2007, 03:22 PM
Why not just do it like this?

Option Explicit

Sub MyHeaderFooter()
With ActiveSheet.PageSetup
' Replace with your own text where appropriate

'Center header will display in Arial Bold 16 pt font
.CenterHeader = "&""Arial,Bold""&16My Custom Header"

' Right and left headers not used in this example


' Left footer will display date and time on one line and
' File and Tab on next
.LeftFooter = "&D &T" & Chr(10) & "&F &A"
' Center footer will display Page x of y
.CenterFooter = "&P of &N"
' Right footer will display in 8 point Bold Arial
.RightFooter = "&""Arial,Bold""&8My Custom Footer"
End With
End Sub


Regards,

Djblois
02-22-2007, 11:25 AM
I am doing it that way currently. However, the XLM way runs much quicker.

johnske
02-22-2007, 05:09 PM
You can use xlDialogPageSetup to do this Example (http://www.theofficeexperts.com/forum/archive/index.php/t-675.html)

Djblois
02-23-2007, 07:09 AM
Does that show the page setup dialog? cause I don't want it too. Also can I change everything in that from the pages high to print gridlines? Does it run quicker than the other way?

lucas
02-23-2007, 08:02 AM
Why don't you test it?

johnske
02-23-2007, 08:03 AM
Does that show the page setup dialog?
No
cause I don't want it too. Also can I change everything in that from the pages high to print gridlines?
Check the arguments
Does it run quicker than the other way?
Yes

Djblois
02-23-2007, 08:10 AM
thank you john for the help.