Pages setting

G

Guest

Hi,

I have a various number of rows generated in a worksheet.
So There is a various number of pagebreak in this sheet.
[I notice that the text in the last cell, of the last row just befre a
pagebreak is wrap to the first cell of the first row just after the
pagebreak.]

I would like to locate the the last row of each page, and the last cell of
this row.

Suppose i have two pages, i consider the last row(just before the break) of
the first page:

If this cell contains a carriage return, then i want to change the page
setting to the next row, if the next row contains a carraige return, do the
same process.
Or perhaps remove this carriage return maybe works fine, but how could i do
that?

Thanks
 
G

Guest

If the pagebreak is an automatic pagebreak, then the reason it is there is
that the printer has to break there - so the direction of movement would be
to include fewer rows on that page.

You can go through the HPageBreaks collection to find the pagebreaks. Just
keep in mind that unless this is just for your printer, it could be different
of different machines.

My experience with pagebreaks are that they are woefully inadequate for the
scenario you describe where you may be successively changing the pagebreak
for multiple pages - in otherwords, it doesn't work.


http://support.microsoft.com/?id=134731
XL: PageBreak Property Does Not Work as Expected


http://support.microsoft.com/?id=118589
XL: Macro to Check for Page Breaks on Worksheet


http://support.microsoft.com/?id=170635
XL97: Run-Time Error 9 When Using a Macro to Remove Page Break


http://support.microsoft.com/?id=89311
XL: Manual Page Breaks Ignored with Fit To Page/Adjust To


http://support.microsoft.com/?id=218104
XL97: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location


http://support.microsoft.com/?id=210663
XL2000: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location

I haven't visited those in a while, so no guarantee that they all still
exist.
 
G

Guest

I see.

So the story is:
A delphi application (can't change anything in) writes data to a Access
database. People who populate those information uses carriage return.
From this database an Outlook VBA code open a descriptor to a file and write
the recordset in it. And then create reporting with Excel (from template
files).
The idea is to remove the carriage return with the trim function, in this
code, on the recordset.
But this didn't work.

If you have an idea to erase the carriage return from the database column it
would be OK.
Thanks.

Tom Ogilvy said:
If the pagebreak is an automatic pagebreak, then the reason it is there is
that the printer has to break there - so the direction of movement would be
to include fewer rows on that page.

You can go through the HPageBreaks collection to find the pagebreaks. Just
keep in mind that unless this is just for your printer, it could be different
of different machines.

My experience with pagebreaks are that they are woefully inadequate for the
scenario you describe where you may be successively changing the pagebreak
for multiple pages - in otherwords, it doesn't work.


http://support.microsoft.com/?id=134731
XL: PageBreak Property Does Not Work as Expected


http://support.microsoft.com/?id=118589
XL: Macro to Check for Page Breaks on Worksheet


http://support.microsoft.com/?id=170635
XL97: Run-Time Error 9 When Using a Macro to Remove Page Break


http://support.microsoft.com/?id=89311
XL: Manual Page Breaks Ignored with Fit To Page/Adjust To


http://support.microsoft.com/?id=218104
XL97: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location


http://support.microsoft.com/?id=210663
XL2000: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location

I haven't visited those in a while, so no guarantee that they all still
exist.
--
Regards,
Tom Ogilvy


OoOuio said:
Hi,

I have a various number of rows generated in a worksheet.
So There is a various number of pagebreak in this sheet.
[I notice that the text in the last cell, of the last row just befre a
pagebreak is wrap to the first cell of the first row just after the
pagebreak.]

I would like to locate the the last row of each page, and the last cell of
this row.

Suppose i have two pages, i consider the last row(just before the break) of
the first page:

If this cell contains a carriage return, then i want to change the page
setting to the next row, if the next row contains a carraige return, do the
same process.
Or perhaps remove this carriage return maybe works fine, but how could i do
that?

Thanks
 
G

Guest

If it actually has a carriage return and the cell is not formatted for wraptext

activecell.value = Replace(activecell.value,chr(10)," ")

--
Regards,
Tom Ogilvy


OoOuio said:
I see.

So the story is:
A delphi application (can't change anything in) writes data to a Access
database. People who populate those information uses carriage return.
From this database an Outlook VBA code open a descriptor to a file and write
the recordset in it. And then create reporting with Excel (from template
files).
The idea is to remove the carriage return with the trim function, in this
code, on the recordset.
But this didn't work.

If you have an idea to erase the carriage return from the database column it
would be OK.
Thanks.

Tom Ogilvy said:
If the pagebreak is an automatic pagebreak, then the reason it is there is
that the printer has to break there - so the direction of movement would be
to include fewer rows on that page.

You can go through the HPageBreaks collection to find the pagebreaks. Just
keep in mind that unless this is just for your printer, it could be different
of different machines.

My experience with pagebreaks are that they are woefully inadequate for the
scenario you describe where you may be successively changing the pagebreak
for multiple pages - in otherwords, it doesn't work.


http://support.microsoft.com/?id=134731
XL: PageBreak Property Does Not Work as Expected


http://support.microsoft.com/?id=118589
XL: Macro to Check for Page Breaks on Worksheet


http://support.microsoft.com/?id=170635
XL97: Run-Time Error 9 When Using a Macro to Remove Page Break


http://support.microsoft.com/?id=89311
XL: Manual Page Breaks Ignored with Fit To Page/Adjust To


http://support.microsoft.com/?id=218104
XL97: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location


http://support.microsoft.com/?id=210663
XL2000: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location

I haven't visited those in a while, so no guarantee that they all still
exist.
--
Regards,
Tom Ogilvy


OoOuio said:
Hi,

I have a various number of rows generated in a worksheet.
So There is a various number of pagebreak in this sheet.
[I notice that the text in the last cell, of the last row just befre a
pagebreak is wrap to the first cell of the first row just after the
pagebreak.]

I would like to locate the the last row of each page, and the last cell of
this row.

Suppose i have two pages, i consider the last row(just before the break) of
the first page:

If this cell contains a carriage return, then i want to change the page
setting to the next row, if the next row contains a carraige return, do the
same process.
Or perhaps remove this carriage return maybe works fine, but how could i do
that?

Thanks
 
G

Guest

Thanks
it's work pretty good
(treating the problem in excel was to late, so i treated it in the text file
that populate the excel template)
I used it like that (with a recordset):

If rst.RecordCount > 0 Then
rst.MoveFirst
For i = 1 To rst.RecordCount
String = """" & rst("Num") & SEPARA _
......
......
& rst("DernierIntervenant") & SEPARA _
& Replace(rst("DernierCommentaire"), Chr(10),
"") & """"
Print #NFile, String
rst.MoveNext
.....

Tom Ogilvy said:
If it actually has a carriage return and the cell is not formatted for wraptext

activecell.value = Replace(activecell.value,chr(10)," ")

--
Regards,
Tom Ogilvy


OoOuio said:
I see.

So the story is:
A delphi application (can't change anything in) writes data to a Access
database. People who populate those information uses carriage return.
From this database an Outlook VBA code open a descriptor to a file and write
the recordset in it. And then create reporting with Excel (from template
files).
The idea is to remove the carriage return with the trim function, in this
code, on the recordset.
But this didn't work.

If you have an idea to erase the carriage return from the database column it
would be OK.
Thanks.

Tom Ogilvy said:
If the pagebreak is an automatic pagebreak, then the reason it is there is
that the printer has to break there - so the direction of movement would be
to include fewer rows on that page.

You can go through the HPageBreaks collection to find the pagebreaks. Just
keep in mind that unless this is just for your printer, it could be different
of different machines.

My experience with pagebreaks are that they are woefully inadequate for the
scenario you describe where you may be successively changing the pagebreak
for multiple pages - in otherwords, it doesn't work.


http://support.microsoft.com/?id=134731
XL: PageBreak Property Does Not Work as Expected


http://support.microsoft.com/?id=118589
XL: Macro to Check for Page Breaks on Worksheet


http://support.microsoft.com/?id=170635
XL97: Run-Time Error 9 When Using a Macro to Remove Page Break


http://support.microsoft.com/?id=89311
XL: Manual Page Breaks Ignored with Fit To Page/Adjust To


http://support.microsoft.com/?id=218104
XL97: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location


http://support.microsoft.com/?id=210663
XL2000: "Subscript Out of Range" Using HPageBreaks or VPageBreaks.Location

I haven't visited those in a while, so no guarantee that they all still
exist.
--
Regards,
Tom Ogilvy


:

Hi,

I have a various number of rows generated in a worksheet.
So There is a various number of pagebreak in this sheet.
[I notice that the text in the last cell, of the last row just befre a
pagebreak is wrap to the first cell of the first row just after the
pagebreak.]

I would like to locate the the last row of each page, and the last cell of
this row.

Suppose i have two pages, i consider the last row(just before the break) of
the first page:

If this cell contains a carriage return, then i want to change the page
setting to the next row, if the next row contains a carraige return, do the
same process.
Or perhaps remove this carriage return maybe works fine, but how could i do
that?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top