Propiedad PageSetup.RightMargin (Excel)

Devuelve o establece el tamaño del margen derecho, en puntos. Double de lectura y escritura.

Sintaxis

expresión. Rightmargin

Expresión Variable que representa un objeto PageSetup .

Comentarios

Los márgenes se establecen o devuelven en puntos. Use el método InchesToPoints o el método CentímetrosToPoints para realizar la conversión.

Ejemplo:

Este ejemplo establece el margen derecho de Sheet1 en 1,5 pulgadas.

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

Este ejemplo establece el margen derecho de Sheet1 en 2 centímetros.

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

Este ejemplo muestra el valor actual del margen derecho para Sheet1.

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

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.