Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pages setting

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Pages setting

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" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pages setting

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" wrote:

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" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Pages setting

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" wrote:

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" wrote:

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" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pages setting = OK

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" wrote:

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" wrote:

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" wrote:

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" wrote:

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

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
Setting pages breaks in Excel Pretzil Excel Discussion (Misc queries) 1 October 13th 06 11:15 PM
Setting scroll area for multiple pages JAMES SYLVESTERSR[_2_] Excel Programming 2 February 10th 04 08:49 PM
Setting zoom for all worksheet pages don lloyd Excel Programming 1 July 17th 03 01:40 AM
Setting zoom for all worksheet pages skmr3 Excel Programming 0 July 15th 03 02:53 AM
Setting zoom for all worksheet pages Paul B[_6_] Excel Programming 0 July 15th 03 02:45 AM


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