Margin Lines in Print-Preview Mode

  • Thread starter Tim & Sue Childs
  • Start date
T

Tim & Sue Childs

Hi

Is it possible to programmatically control ahving the print margins appear
on a print preview. At the moment, I have a print macro and have to press
the "Margins" button (great hardship!!) to get this to happen, but would
like these to be in plae under the control of VBA.

Thanks in advance

Tim
 
J

JLGWhiz

This is from VBA help files:

With Worksheets(1).PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1.5)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
End With

You just need to be in the correct mode. PageSetup is where the margins are
set.
 
T

Tim Childs

Hi

thanks for that. I was hoping the response would definitively say whether
this feature (or property) can be controlled form VBA itself rather than
being turned on at the keyboard.

with apologies to all pragmatists in the newsgroup :)

thanks

Tim
 
Top