PC Review


Reply
Thread Tools Rate Thread

How to compare the max width of a cell compared to the max width of awksht page?

 
 
Chet
Guest
Posts: n/a
 
      18th Feb 2008
I am trying to cycle through a workbook and perform a pagesetup
command in order to prepare the page for printing. Some of my pages
will be 1 page tall & 1 page wide, and some will be 2 pages tall and 1
wide, and a few will be 3 pages tall and 1 page wide. (No problem on
the cycling through part.)

My goal is to use the code to prevent a small portion of my worksheet
from showing up on page 2 of a print-out when maybe by using
the .PrintArea command and the .FitToPagesTall command to control how
many pages the worksheet prints on.

My question is (possibly I am going about it the wrong way) but I am
using the
ActiveSheet.PageSetup.PrintArea = "$A$1:" & BotRightCell
command to set the print area. My problem is that the BotRightCell
does not extend as far out as some of the cells higher up in the
worksheet so when I use the .printarea command it cuts off this text
which extends further to the right.

I am also using the .pageheight command to set the number of vertical
pages I have with the following code.-
'GET NBR OF VERTICAL PAGES
VerticalPages =
Application.WorksheetFunction.RoundUp(PageHeight / 1100, 0)
If VerticalPages < 1 Then
VerticalPages = 1
GoTo Skip2
End If
If VerticalPages > 4 Then
VerticalPages = 4
GoTo Skip2
End If
As you can see below my sample data has the first row as "2 CHANGE
IMPACT AND ACTION REQUIRED" , but the other rows are much more
narrow. So If I set the width of the page on the very "right most"
cell then I will cut off the display of the first row because it is
simply wider than the last row.

I hope this makes sense.

Thanks,
Chet

Sample of what a page looks like. (All data in column A).
2. CHANGE, IMPACT, AND ACTION REQUIRED

A. Change:
Impact:
Action:

B. Change:

Impact:
Action:
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      19th Feb 2008
I am not so sure that Excel was you best choice of applications to use for
what you are trying to do. It would have been much easier in MS Word.

BTW you will probably get an error message with the BottomRightCell
expression if you try to use it for a data column. It is a property of
Shapes, Charts and OLEObjects but not Range objects.

"Chet" wrote:

> I am trying to cycle through a workbook and perform a pagesetup
> command in order to prepare the page for printing. Some of my pages
> will be 1 page tall & 1 page wide, and some will be 2 pages tall and 1
> wide, and a few will be 3 pages tall and 1 page wide. (No problem on
> the cycling through part.)
>
> My goal is to use the code to prevent a small portion of my worksheet
> from showing up on page 2 of a print-out when maybe by using
> the .PrintArea command and the .FitToPagesTall command to control how
> many pages the worksheet prints on.
>
> My question is (possibly I am going about it the wrong way) but I am
> using the
> ActiveSheet.PageSetup.PrintArea = "$A$1:" & BotRightCell
> command to set the print area. My problem is that the BotRightCell
> does not extend as far out as some of the cells higher up in the
> worksheet so when I use the .printarea command it cuts off this text
> which extends further to the right.
>
> I am also using the .pageheight command to set the number of vertical
> pages I have with the following code.-
> 'GET NBR OF VERTICAL PAGES
> VerticalPages =
> Application.WorksheetFunction.RoundUp(PageHeight / 1100, 0)
> If VerticalPages < 1 Then
> VerticalPages = 1
> GoTo Skip2
> End If
> If VerticalPages > 4 Then
> VerticalPages = 4
> GoTo Skip2
> End If
> As you can see below my sample data has the first row as "2 CHANGE
> IMPACT AND ACTION REQUIRED" , but the other rows are much more
> narrow. So If I set the width of the page on the very "right most"
> cell then I will cut off the display of the first row because it is
> simply wider than the last row.
>
> I hope this makes sense.
>
> Thanks,
> Chet
>
> Sample of what a page looks like. (All data in column A).
> 2. CHANGE, IMPACT, AND ACTION REQUIRED
>
> A. Change:
> Impact:
> Action:
>
> B. Change:
>
> Impact:
> Action:
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Design View, report width is greater than page width error SPS Microsoft Access Reports 4 16th Mar 2009 07:47 PM
word 2007--change copy from 1/2 of width of page to full width of page? aaronep@pacbell.net Microsoft Word New Users 4 12th Feb 2007 02:07 PM
Textbox width scaling to width of data not width of page? AndrewF Microsoft ASP .NET 1 10th Oct 2005 05:38 PM
setting cell width in data sheet and subreport width =?Utf-8?B?Q2hyaXM=?= Microsoft Access Forms 0 27th Apr 2005 11:07 PM
Go back to the full page width Contact Notes. The new page width. =?Utf-8?B?amxkYXZpczEy?= Microsoft Outlook Contacts 0 31st Jan 2005 08:59 PM


Features
 

Advertising
 

Newsgroups
 


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