Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default setting up the print area

Hi,

I have a set of data that has been exported from Access into an Excel sheet.
The data has a fixed column width from A to AO, in row 24 going down. The
number of rows of data is not fixed.

What I want to do is automate setting the print area which will include all
the visible data when a button is clicked. I'm finding this hard because
there are a number of columns within the A:AO range that will be hidden, but
not always the same ones.

I also want the print area to incude the visible blank cells from the
("A1:AO24") range above this data - but not the blank rows below the last row
of data.

Also the AP column, to the right of the data contains text that i don't want
to include in the print area.

Can anyone help?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default setting up the print area

Dim lastRow as Long
lastrow = cells(rows.count,1).End(xlup).row

Activesheet.PageSetup.PrintArea = "'" & Activesheet.Name & _
"'!$A$1:$AO$" & lastrow

--
Regards,
Tom Ogilvy


"Gina" wrote:

Hi,

I have a set of data that has been exported from Access into an Excel sheet.
The data has a fixed column width from A to AO, in row 24 going down. The
number of rows of data is not fixed.

What I want to do is automate setting the print area which will include all
the visible data when a button is clicked. I'm finding this hard because
there are a number of columns within the A:AO range that will be hidden, but
not always the same ones.

I also want the print area to incude the visible blank cells from the
("A1:AO24") range above this data - but not the blank rows below the last row
of data.

Also the AP column, to the right of the data contains text that i don't want
to include in the print area.

Can anyone help?

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting The Print-Area ? Robert11[_3_] New Users to Excel 2 May 31st 09 03:24 PM
setting print area Nick Smith[_2_] Excel Programming 3 April 26th 06 10:39 AM
Setting the print area Patch61 Excel Programming 5 April 18th 06 04:42 PM
Setting Print Area dolppm Excel Programming 2 March 8th 05 09:35 PM
Setting print area Don Guillett[_4_] Excel Programming 0 September 4th 03 02:14 PM


All times are GMT +1. The time now is 03:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"