Adjust the print range of a list

  • Thread starter Thread starter pja
  • Start date Start date
P

pja

I import data (names etc) using a macro. The macro makes a kind o
signature-list, layout with borderlines etc.
Sometimes the data contains 10 names and sometimes 200 names.

If the list only contains 10 names and I want to print, the first pag
contains de 10 names the rest of the pages are filled with only th
layout (created for the max. of 200 names)

Is it possible that the area of printing is set automaticall
containing the last name when the next cell in the column is empty ?
The names are in the first column.

Thnx

PJ
 
Hi
try a macro like the following:
Sub print_rows()
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
wirh ActiveSheet
.PageSetup.PrintArea = "$A$1:$A$" & LastRow
.PrintOut
End With
End Sub
 
Back
Top