ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Temporarily Suppressing the Printing of Page Footers (https://www.excelbanter.com/excel-programming/451497-temporarily-suppressing-printing-page-footers.html)

Tim Childs[_10_]

Temporarily Suppressing the Printing of Page Footers
 
Hi

I am creating a formal document (annual accounts) in Excel and while
working on the Excel file want the page footers to print but need to be
able to suppress the footers to show the draft pages as they will look
finally. I am doing this by printing the footer “white-on-white”. I then
want to revert to having the original footers by having black font in
the footer.

So I will use code along the lines:
..LeftFooter = "&K00+000”&.LeftFooter

but need to be able to eliminate any previous “&K..” coding in the
original .LeftFooter, which Excel does automatically when changing the
code manually.

Can someone tell me how to eliminate programmatically any previous font
colour coding in the footer?

Many thanks

Tim

GS[_6_]

Temporarily Suppressing the Printing of Page Footers
 
Hi

I am creating a formal document (annual accounts) in Excel and while
working on the Excel file want the page footers to print but need to
be able to suppress the footers to show the draft pages as they will
look finally. I am doing this by printing the footer
€śwhite-on-white€ť. I then want to revert to having the original
footers by having black font in the footer.

So I will use code along the lines:
.LeftFooter = "&K00+000€ť&.LeftFooter

but need to be able to eliminate any previous €ś&K..€ť coding in the
original .LeftFooter, which Excel does automatically when changing
the code manually.

Can someone tell me how to eliminate programmatically any previous
font colour coding in the footer?

Many thanks

Tim


I'm not understanding your issue! Any 'new' settings made in .PageSetup
prior to Printout will persist until changed again. Perhaps all you
need to do is build a custom procedure that will 'toggle' this at
runtime...

Sub PrintDoc(Optional DraftMode As Boolean = False)
Dim sColor$
Const sWhite$ = "&K00+000": Const sBlack$ = "&K000000"

sColor = IIf(DraftMode, sWhite, sBlack)
With ActiveSheet.PageSetup
.LeftFooter = sColor & .LeftFooter
'and so on...
End With 'ActiveSheet
ActiveSheet.PrintOut

End Sub

...and use it like this...

Sub PrintFormalDoc()
PrintDoc
End Sub

Sub PrintDraftDoc()
PrintDoc True
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Tim Childs[_10_]

Temporarily Suppressing the Printing of Page Footers
 
On 10-Jun-16 3:57 PM, Tim Childs wrote:
Hi

I am creating a formal document (annual accounts) in Excel and while
working on the Excel file want the page footers to print but need to be
able to suppress the footers to show the draft pages as they will look
finally. I am doing this by printing the footer “white-on-white”. I then
want to revert to having the original footers by having black font in
the footer.

So I will use code along the lines:
.LeftFooter = "&K00+000”&.LeftFooter

but need to be able to eliminate any previous “&K..” coding in the
original .LeftFooter, which Excel does automatically when changing the
code manually.

Can someone tell me how to eliminate programmatically any previous font
colour coding in the footer?

Many thanks

Tim


Hi Garry

Thanks v much for response. The issue was the way I was embedding the
colour constants into the footer whereas you have shown me a way that
enables me to avoid doing this.

I will incorporate it into my print procedure.

Best wishes

Tim

GS[_6_]

Temporarily Suppressing the Printing of Page Footers
 
On 10-Jun-16 3:57 PM, Tim Childs wrote:
Hi

I am creating a formal document (annual accounts) in Excel and
while
working on the Excel file want the page footers to print but need
to be
able to suppress the footers to show the draft pages as they will
look
finally. I am doing this by printing the footer €śwhite-on-white€ť. I
then
want to revert to having the original footers by having black font
in
the footer.

So I will use code along the lines:
.LeftFooter = "&K00+000€ť&.LeftFooter

but need to be able to eliminate any previous €ś&K..€ť coding in the
original .LeftFooter, which Excel does automatically when changing
the
code manually.

Can someone tell me how to eliminate programmatically any previous
font
colour coding in the footer?

Many thanks

Tim


Hi Garry

Thanks v much for response. The issue was the way I was embedding the
colour constants into the footer whereas you have shown me a way that
enables me to avoid doing this.

I will incorporate it into my print procedure.

Best wishes

Tim


Thanks for the feedback...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com