ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Print Area (https://www.excelbanter.com/excel-programming/370254-auto-print-area.html)

Kstalker[_50_]

Auto Print Area
 

Hello

I have read through various threads and found what I need but canno
pull it together due to inexperience.

I am trying set up the print area to adjust according to the number o
rows in a sheet. The rows change depending on what the sheet use
selects but the columns always stay constant. I have looked a
usedrange however it picks up the formatted cells so prints blan
pages.

Is there a way that I can add a count into the string below??
In the active sheet that I am printing there is an index in column
that I could search for the last entry and add 3 rows which would the
print everything. However there are blanks within column d

ActiveSheet.PageSetup.PrintArea = "$b$3$am$" & countsomething & ""


Any help appreciate

--
Kstalke
-----------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...fo&userid=2469
View this thread: http://www.excelforum.com/showthread.php?threadid=57125


Jim Cone

Auto Print Area
 
To find the last cell with data in a column, start at the bottom of the
column and look up...

Dim lngRow as Long
lngRow = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Kstalker"
wrote in message
Hello
I have read through various threads and found what I need but cannot
pull it together due to inexperience.

I am trying set up the print area to adjust according to the number of
rows in a sheet. The rows change depending on what the sheet user
selects but the columns always stay constant. I have looked at
usedrange however it picks up the formatted cells so prints blank
pages.

Is there a way that I can add a count into the string below??
In the active sheet that I am printing there is an index in column d
that I could search for the last entry and add 3 rows which would then
print everything. However there are blanks within column d

ActiveSheet.PageSetup.PrintArea = "$b$3$am$" & countsomething & ""
Any help appreciated
--
Kstalker


Kstalker[_51_]

Auto Print Area
 

cheers Jim


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=571255



All times are GMT +1. The time now is 10:23 PM.

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