ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   conditional page set-up (https://www.excelbanter.com/excel-programming/303339-conditional-page-set-up.html)

Dan Wasser[_2_]

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.

JulieD

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.




Dan Wasser[_2_]

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.



.


JulieD

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.



.





All times are GMT +1. The time now is 06:16 AM.

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