Auto Print Area

K

Kstalker

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
 
J

Jim Cone

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top