ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   protected worksheet (https://www.excelbanter.com/excel-programming/318127-protected-worksheet.html)

LennyG

protected worksheet
 
I have prepared a worksheet for user entry in which there are formulas.
The worksheet is protected and I am trying to have interim reports printed
using a
macro. When the current region is selected in the macro, the entire area
including
empty cells with the formulas copied, is selected. How do I get the print
area to
stop at the point where data has been entered, excluding the empty,
formatted rows.

Lynn Arlington

protected worksheet
 
In the code I would put a selection command

Range("b2").Select
Selection.End(xlDown).Select
lastrow = ActiveCell.Row

ActiveSheet.PageSetup.PrintArea = "$A$1:$G$ & lastrow"

Lynn


"LennyG" wrote:

I have prepared a worksheet for user entry in which there are formulas.
The worksheet is protected and I am trying to have interim reports printed
using a
macro. When the current region is selected in the macro, the entire area
including
empty cells with the formulas copied, is selected. How do I get the print
area to
stop at the point where data has been entered, excluding the empty,
formatted rows.



All times are GMT +1. The time now is 03:21 AM.

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