Printing fixed columns and rows

  • Thread starter Thread starter rcorona106
  • Start date Start date
R

rcorona106

Hi,

I've been working on a macro the last couple of days
trying to make it print a few columns and rows that I
want to show on every page I print. The macro works
fine the first time but after that it will not print out
the rows I want it to print on every page. Any help will
be greatly appreciated.

Thanks.
 
Ok, here is part of the code. The rest of :

With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$7"
.PrintTitleColumns = "$A:$E"
End With
ActiveSheet.PageSetup.PrintArea = "$A$1:$AF$43"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 300
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
Rows("10:24").Select
Selection.EntireRow.Hidden = True
Columns("H:J").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=9
Columns("U:AD").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SelectedSheets.PrintPreview
End Sub


As you can see, there are lots of columns in this
spreadsheet. The macro seems to be working fine until I
run it again. The initial print preview shows me exactly
what I want to print out but as soon as I try to run the
macro again I lose the columns a-e and rows 1-7 from the
print range.
-----Original Message-----
Please more information

Show us your code rcorona106.
We can help you then

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




"rcorona106" <[email protected]> wrote
in message news:[email protected]...
 
Back
Top