T
Tim Childs
Hi
John Green has posted the excellent code below that speeds up Pagesetup in
later versions of Excel .
Is it possible within this macro to set the option Print to one page wide
and however many pages tall it requires? - I presume it is the variable
pscale that affects this?
Many thanks
Tim
Sub PS4()
head = """&LMy Company&R&D / &T"""
foot = """&LHighly Confidential and Proprietary&RFinance"""
pLeft = 0.54
pRight = 0.3
Top = 0.4
bot = 0.36
head_margin = 0.22
foot_margin = 0.17
hdng = False
grid = False
Notes = False
quality = ""
h_cntr = False
v_cntr = False
orient = 2
Draft = False
paper_size = 1
pg_num = """Auto"""
pg_order = 1
bw_cells = False
pscale = True
pSetUp = "PAGE.SETUP(" & head & "," & foot & "," & pLeft & "," & pRight &
","
pSetUp = pSetUp & Top & "," & bot & "," & hdng & "," & grid & "," & h_cntr &
","
pSetUp = pSetUp & v_cntr & "," & orient & "," & paper_size & "," & pscale &
","
pSetUp = pSetUp & pg_num & "," & pg_order & "," & bw_cells & "," & quality &
","
pSetUp = pSetUp & head_margin & "," & foot_margin & "," & Notes & "," &
Draft & ")"
Application.ExecuteExcel4Macro pSetUp
End Sub
John Green has posted the excellent code below that speeds up Pagesetup in
later versions of Excel .
Is it possible within this macro to set the option Print to one page wide
and however many pages tall it requires? - I presume it is the variable
pscale that affects this?
Many thanks
Tim
Sub PS4()
head = """&LMy Company&R&D / &T"""
foot = """&LHighly Confidential and Proprietary&RFinance"""
pLeft = 0.54
pRight = 0.3
Top = 0.4
bot = 0.36
head_margin = 0.22
foot_margin = 0.17
hdng = False
grid = False
Notes = False
quality = ""
h_cntr = False
v_cntr = False
orient = 2
Draft = False
paper_size = 1
pg_num = """Auto"""
pg_order = 1
bw_cells = False
pscale = True
pSetUp = "PAGE.SETUP(" & head & "," & foot & "," & pLeft & "," & pRight &
","
pSetUp = pSetUp & Top & "," & bot & "," & hdng & "," & grid & "," & h_cntr &
","
pSetUp = pSetUp & v_cntr & "," & orient & "," & paper_size & "," & pscale &
","
pSetUp = pSetUp & pg_num & "," & pg_order & "," & bw_cells & "," & quality &
","
pSetUp = pSetUp & head_margin & "," & foot_margin & "," & Notes & "," &
Draft & ")"
Application.ExecuteExcel4Macro pSetUp
End Sub