ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PrintArea Query (https://www.excelbanter.com/excel-programming/380345-printarea-query.html)

James Cornthwaite

PrintArea Query
 
Hi,

I have had a go at writing a macro to set the print area equal to A4 size
paper at 100% scaling.

However, it was crude and doesnt work very well.

I suspect there could be an easier way.


Currently I have

activesheet.pagesetup.printarea = "A1:XX"

XX = where I awkwardly calculate the bottom right cell which falls on the
natural page break for A4.

However this doesnt work all the time.

Is there an easier to way.
It is a relevant problem here because the row height and colums widths
change and I want the print area to follow the changes to maintain the A4
size

My question is how can I set the print area equal to the columns and rows
which occupy A4 at 100% scaling.
I know its a strange question but there is reason why I need to set the
print area myself.


Many many thanks
James



Tom Ogilvy

PrintArea Query
 
find the pagebreaks with your code. Use the VPageBreaks and HPageBreaks
collections.

--
Regards,
Tom Ogilvy


"James Cornthwaite" wrote in message
...
Hi,

I have had a go at writing a macro to set the print area equal to A4 size
paper at 100% scaling.

However, it was crude and doesnt work very well.

I suspect there could be an easier way.


Currently I have

activesheet.pagesetup.printarea = "A1:XX"

XX = where I awkwardly calculate the bottom right cell which falls on the
natural page break for A4.

However this doesnt work all the time.

Is there an easier to way.
It is a relevant problem here because the row height and colums widths
change and I want the print area to follow the changes to maintain the A4
size

My question is how can I set the print area equal to the columns and rows
which occupy A4 at 100% scaling.
I know its a strange question but there is reason why I need to set the
print area myself.


Many many thanks
James




James Cornthwaite

PrintArea Query
 
Ah right
I'll give it a go thanks

Might have to come back to you (if thats ok) and show you what I've done if
I cant get it to work.

Thanks
James


"Tom Ogilvy" wrote in message
...
find the pagebreaks with your code. Use the VPageBreaks and HPageBreaks
collections.

--
Regards,
Tom Ogilvy


"James Cornthwaite" wrote in message
...
Hi,

I have had a go at writing a macro to set the print area equal to A4 size
paper at 100% scaling.

However, it was crude and doesnt work very well.

I suspect there could be an easier way.


Currently I have

activesheet.pagesetup.printarea = "A1:XX"

XX = where I awkwardly calculate the bottom right cell which falls on the
natural page break for A4.

However this doesnt work all the time.

Is there an easier to way.
It is a relevant problem here because the row height and colums widths
change and I want the print area to follow the changes to maintain the A4
size

My question is how can I set the print area equal to the columns and rows
which occupy A4 at 100% scaling.
I know its a strange question but there is reason why I need to set the
print area myself.


Many many thanks
James







All times are GMT +1. The time now is 01:40 AM.

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