civilmonkey
New Member
- Joined
- Feb 20, 2008
- Messages
- 14
Hello all,
I have a macro that allows a user to edit a multi line text box from a form. The macro uses the XL4 PAGE.SETUP macro to modify the headers and footers as it's faster then using something like activesheet.pagesetup.leftheader = "new header"
(http://google.com/groups?selm=VA.00000b2f.0028c7e5@mara9)
My macro literally sets the left header (or whatever) equal to the .Text property of forms textbox. My problem is that if the user adds a carriage return using ctrl-enter or shift-enter, when you do a print preview excel shows a blank line in the header where the user added a carriage return.
I have tried removing the special characters 10 and/or 13 but it doesn't seem to help.
Even more funny is that if I remove the extra space in Excel's page setup dialog box the space stays removed, however if I populate a string in VBA with the pages header, then apply the extra string back to the header, the space re-appears.
Finally, I have looked at the header string character by character. In both cases, when my header has two seperate lines and when Excel shows the blank line between them and when it doesn't, the only special characters present in the string are 13 and 10.
Here is a small screen shot if that helps:
http://img199.imageshack.us/img199/8956/extraspace.jpg
Did I explain my problem enough and if so do you have any suggestions?
Thanks very very much in advance,
Paul Hurst
I have a macro that allows a user to edit a multi line text box from a form. The macro uses the XL4 PAGE.SETUP macro to modify the headers and footers as it's faster then using something like activesheet.pagesetup.leftheader = "new header"
(http://google.com/groups?selm=VA.00000b2f.0028c7e5@mara9)
My macro literally sets the left header (or whatever) equal to the .Text property of forms textbox. My problem is that if the user adds a carriage return using ctrl-enter or shift-enter, when you do a print preview excel shows a blank line in the header where the user added a carriage return.
I have tried removing the special characters 10 and/or 13 but it doesn't seem to help.
Even more funny is that if I remove the extra space in Excel's page setup dialog box the space stays removed, however if I populate a string in VBA with the pages header, then apply the extra string back to the header, the space re-appears.
Finally, I have looked at the header string character by character. In both cases, when my header has two seperate lines and when Excel shows the blank line between them and when it doesn't, the only special characters present in the string are 13 and 10.
Here is a small screen shot if that helps:
http://img199.imageshack.us/img199/8956/extraspace.jpg
Did I explain my problem enough and if so do you have any suggestions?
Thanks very very much in advance,
Paul Hurst