Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Print Margin Problem

Status
Not open for further replies.
Jul 22, 2002
25
US
All,

I'm trying to set the Print Margin's in Excel's VBA. My settings are not taking when the print margin is something different before you open my file. The code I am using is below. If the "default" worksheet has top and bottom margins of 1.125", then they stay that way.

'Print the specified area
ThisWorkbook.Worksheets("Estimate").PageSetup.PrintArea = "$A$1:$S$90"
ThisWorkbook.Worksheets("Estimate").PageSetup.TopMargin = 0.875
ThisWorkbook.Worksheets("Estimate").PageSetup.BottomMargin = 0.875

Anybody help me?
 
Try using
ThisWorkbook.Worksheets("Estimate").PageSetup.TopMargin = Application.InchesToPoints(0.85)

Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top