Print Setup

  • Thread starter Thread starter Michele
  • Start date Start date
M

Michele

The following code does what is needed correctly, EXCEPT
the correct file name does not show up correctly unless:
After the whole procedure is finished, you then go into
page setup, go to the Headers/Footers tab, click on Custom
Footers, then just click OK,and OK again and then the file
name derived from "&[File]" appears correctly. I've tried
placing "&[File]" in different parts of the code, but
still, it won't recognize it until you go back into the
Custom Footer section and just click OK.

Is there some type of refresh command that I can use for
the Page Setup section? Thank you.


thepth is derived from the code before the following:

rgtft = "&[File]"

With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&""Arial,Bold""&16&E" &
ActiveCell.Value & Chr(10) & "&12&E" & ActiveCell.Offset
(rowoffset:=1, columnoffset:=0)
.LeftFooter = Format(Date, "mm/dd/yyyy")
thisfile = thepth
.RightFooter = "&""Arial""&7" & thisfile & "\" &
rgtft
.CenterFooter = "&8&P of &N"
.Orientation = xlLandscape
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
End With
 
Thank you so much Frank!!!!!!!
-----Original Message-----
Hi
try changing
rgtft = "&[File]"
to
rgtft = "&F"

--
Regards
Frank Kabel
Frankfurt, Germany

The following code does what is needed correctly, EXCEPT
the correct file name does not show up correctly unless:
After the whole procedure is finished, you then go into
page setup, go to the Headers/Footers tab, click on Custom
Footers, then just click OK,and OK again and then the file
name derived from "&[File]" appears correctly. I've tried
placing "&[File]" in different parts of the code, but
still, it won't recognize it until you go back into the
Custom Footer section and just click OK.

Is there some type of refresh command that I can use for
the Page Setup section? Thank you.


thepth is derived from the code before the following:

rgtft = "&[File]"

With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&""Arial,Bold""&16&E" &
ActiveCell.Value & Chr(10) & "&12&E" & ActiveCell.Offset
(rowoffset:=1, columnoffset:=0)
.LeftFooter = Format(Date, "mm/dd/yyyy")
thisfile = thepth
.RightFooter = "&""Arial""&7" & thisfile & "\" &
rgtft
.CenterFooter = "&8&P of &N"
.Orientation = xlLandscape
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
End With
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top