ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting print range (https://www.excelbanter.com/excel-programming/387022-selecting-print-range.html)

Tamas Konczer

Selecting print range
 
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address

There is some empty row in the print range. In this case this formula
is not fine for me.

or

ActiveSheet.PageSetup.PrintArea = "R3C1:R15C2"

In this case I cannot use variable.

What is the solution for that issue?


excelent

Selecting print range
 
Try this: is selecting range form activecell to last nonempty cell

ActiveSheet.PageSetup.PrintArea = Range(ActiveCell,
ActiveCell.SpecialCells(xlLastCell)).Address


"Tamas Konczer" skrev:

ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address

There is some empty row in the print range. In this case this formula
is not fine for me.

or

ActiveSheet.PageSetup.PrintArea = "R3C1:R15C2"

In this case I cannot use variable.

What is the solution for that issue?



Tamas Konczer

Selecting print range
 
Thank you for your help!

excelent írta:
Try this: is selecting range form activecell to last nonempty cell

ActiveSheet.PageSetup.PrintArea = Range(ActiveCell,
ActiveCell.SpecialCells(xlLastCell)).Address


"Tamas Konczer" skrev:

ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address

There is some empty row in the print range. In this case this formula
is not fine for me.

or

ActiveSheet.PageSetup.PrintArea = "R3C1:R15C2"

In this case I cannot use variable.

What is the solution for that issue?




All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com