View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default I recorded a macro "PrintSetUp" in excel but does not work

On Aug 10, 3:28 am, Niranjan
wrote:
I am using office 2003.
I have created a budget file in excell with different macros recorded.
However when I try to record another macro in the same file such as Print
Preview or Print SetUp it does not work. Please assist how to go about it


i recorded print preview & got this:
ActiveWindow.SelectedSheets.PrintPreview

these are the properties (below) that you can use page set-up in a
macro. warning! using page set up (i have seen other posts) slows
down code drastically.

With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$3"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$A$1:$M$45"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = "&8&D &P"
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.25)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 400
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With

hope this gives you a place to start!
:)
susan