Excel Macros

  • Thread starter Thread starter TJAC
  • Start date Start date
T

TJAC

When creating a macro in Excel 2003, is there a way to change the margins and
print area within the macro? Every time I have tried Excel does not like it
and normally stops the macro in that location of code.

Thanks,
Trisha
 
hi
not sure what you mean but is this what you're look for????
With ActiveSheet.PageSetup
.PrintArea = "$A$1:$J$20"
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.85)
.BottomMargin = Application.InchesToPoints(0.85)
.HeaderMargin = Application.InchesToPoints(0.15)
.FooterMargin = Application.InchesToPoints(0.15)
End With

regards
FSt1
 

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