ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   page break (https://www.excelbanter.com/excel-programming/289116-page-break.html)

mike

page break
 
Is it possible for a macro to find a word in the cell and
use it as it end point for page break? I will like to
have a page break on every cell that have the
word "Sales grand total". Thanks in advance

Tom Ogilvy

page break
 
Turn on the macro recorder

do edit=find
type in
Sales grand total

when it is found, do Insert=PageBreak

Turn off the macro recorder. Adapt the recorded code to your needs.

Note that if the cells are farther apart than what can fit on a page, that
you may not get the results you expect. This only works if the distance can
be contained on an entire page.

--
Regards,
Tom Ogilvy

mike wrote in message
...
Is it possible for a macro to find a word in the cell and
use it as it end point for page break? I will like to
have a page break on every cell that have the
word "Sales grand total". Thanks in advance





All times are GMT +1. The time now is 08:49 PM.

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