Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default conditional page set-up

My macro defines the page set-up to be "Fit to 1 page wide
by 2 pages tall." But, sometimes, I need it to be "1 page
wide and THREE pages tall." It depends on how many lines
of data there are after my macro runs. How do I determine
the number of lines of data? In other words, how do I
tell the macro to determine how many lines of data there
are? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default conditional page set-up

Hi Dan

not sure if there's a better way, but this is how i got it to work on some
code i was playing with this morning - i was using landscape orientation ...
and 20 rows seemed to work well for my data.

lrow = ActiveCell.SpecialCells(xlLastCell).Row
i = Val(lrow) / 20
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = i
End With

(there is of course other code around these lines)

cheers
JulieD



"Dan Wasser" wrote in message
...
My macro defines the page set-up to be "Fit to 1 page wide
by 2 pages tall." But, sometimes, I need it to be "1 page
wide and THREE pages tall." It depends on how many lines
of data there are after my macro runs. How do I determine
the number of lines of data? In other words, how do I
tell the macro to determine how many lines of data there
are? Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default conditional page set-up

You're wonderful, Julie. It worked perfectly. Thanks!
Dan

-----Original Message-----
Hi Dan

not sure if there's a better way, but this is how i got

it to work on some
code i was playing with this morning - i was using

landscape orientation ...
and 20 rows seemed to work well for my data.

lrow = ActiveCell.SpecialCells(xlLastCell).Row
i = Val(lrow) / 20
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = i
End With

(there is of course other code around these lines)

cheers
JulieD



"Dan Wasser" wrote in message
...
My macro defines the page set-up to be "Fit to 1 page

wide
by 2 pages tall." But, sometimes, I need it to be "1

page
wide and THREE pages tall." It depends on how many

lines
of data there are after my macro runs. How do I

determine
the number of lines of data? In other words, how do I
tell the macro to determine how many lines of data there
are? Thanks.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default conditional page set-up

Hi Dan

thanks - glad to assist

Cheers
JulieD

"Dan Wasser" wrote in message
...
You're wonderful, Julie. It worked perfectly. Thanks!
Dan

-----Original Message-----
Hi Dan

not sure if there's a better way, but this is how i got

it to work on some
code i was playing with this morning - i was using

landscape orientation ...
and 20 rows seemed to work well for my data.

lrow = ActiveCell.SpecialCells(xlLastCell).Row
i = Val(lrow) / 20
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = i
End With

(there is of course other code around these lines)

cheers
JulieD



"Dan Wasser" wrote in message
...
My macro defines the page set-up to be "Fit to 1 page

wide
by 2 pages tall." But, sometimes, I need it to be "1

page
wide and THREE pages tall." It depends on how many

lines
of data there are after my macro runs. How do I

determine
the number of lines of data? In other words, how do I
tell the macro to determine how many lines of data there
are? 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
Conditional Page Break Mike Saffer Excel Worksheet Functions 7 September 2nd 08 08:12 PM
Conditional Formatting - Before Page Break Monk Excel Discussion (Misc queries) 1 July 22nd 07 04:06 AM
Conditional page break if merged rows won't fit on the page. zbprtal Excel Worksheet Functions 1 April 12th 06 08:53 PM
Conditional page breaks? kintzldj Excel Discussion (Misc queries) 3 January 7th 06 12:27 AM
Are conditional formats available for setting page breaks? Nicky Armstrong Excel Discussion (Misc queries) 1 February 20th 05 03:51 PM


All times are GMT +1. The time now is 06:31 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"