PageSetup.LeftMargin property (Excel)

Returns or sets the size of the left margin, in points. Read/write Double.

Syntax

expression.LeftMargin

expression A variable that represents a PageSetup object.

Remarks

Margins are set or returned in points. Use either the InchesToPoints method or the CentimetersToPoints method to do the conversion.

Example

This example sets the left margin of Sheet1 to 1.5 inches.

Worksheets("Sheet1").PageSetup.LeftMargin = _ 
 Application.InchesToPoints(1.5)

This example sets the left margin of Sheet1 to 2 centimeters.

Worksheets("Sheet1").PageSetup.LeftMargin = _ 
 Application.CentimetersToPoints(2)

This example displays the current left-margin setting for Sheet1.

marginInches = Worksheets("Sheet1").PageSetup.LeftMargin / _ 
 Application.InchesToPoints(1) 
MsgBox "The current left margin is " & marginInches & " inches"

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.