View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Graham Haughs Graham Haughs is offline
external usenet poster
 
Posts: 49
Default Adding in row at bottom of range

Sorry Tom, I made a mess of trying to explain that. Yes I do want to
expand the range by one row but it is to to be a specific row, ie row
160 where the totals are. The range has 159 rows but perhaps only 30 are
filled at any time and the totals of the numbers in the columns in these
rows is shown in row 160. The "AATableA" just prints out these 30 rows
with the column titles and ignores the blank rows but I would like the
print to contain row 160 as well showing the totals.ie I would like the
printout in this case to show rows 1 to 30 with row 160 as row 31 so to
speak. I hope that is a bit clearer with my apologies for confusion and
thanks for your patience.

Graham Haughs
Tom Ogilvy wrote:
What I got out of that is you want to expand the printarea by 1 row?

Dim rng as Range

set rng = Range("AATableA")
set rng = rng.resize(rng.rows.count+)
ActiveSheet.PageSetup.PrintArea = rng.Address(external:=True)
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$5"
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.LeftFooter = "&F"
End With
ActiveWindow.SelectedSheets.PrintOut