Sets the range to be printed using 1-based row and column index numbers, as an alternative to the string-based
PrintArea property
Syntax
procedure SetPrintArea(FirstRow: Word; FirstCol: Word; LastRow: Word; LastCol: Word);
| FirstRow |
Required Word. The 1-based row index of the first row of the print area |
| FirstCol |
Required Word. The 1-based column index of the first column of the print area |
| LastRow |
Required Word. The 1-based row index of the last row of the print area |
| LastCol |
Required Word. The 1-based column index of the last column of the print area |
Remarks
FirstRow, FirstCol, LastRow and LastCol use the same 1-based numbering as the
Cells property. The call is ignored when FirstRow > LastRow, FirstCol > LastCol, or the indexes fall outside the worksheet bounds
Example
This example sets the print area to cells A1:E20 on Worksheet one
Workbook.Sheets[1].PageSetup.SetPrintArea(1, 1, 20, 5);