Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting pages breaks in Excel | Excel Discussion (Misc queries) | |||
Setting scroll area for multiple pages | Excel Programming | |||
Setting zoom for all worksheet pages | Excel Programming | |||
Setting zoom for all worksheet pages | Excel Programming | |||
Setting zoom for all worksheet pages | Excel Programming |