Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am running Excel v14 in MS Office 2010. I have a routine that puts a two line disclaimer into the footer of each tab in the workbook. The routine also inserts the date in the right hand side of the footer.
If I put the disclaimer and date in manually, no issues. If I insert the same disclaimer via code, the second line of the disclaimer truncates the last six characters of the string. If I leave the date out of the code, it works perfectly. The disclaimer does not bust the 255 character limit. The first line is 43 characters; the second is 68. So, I need to have both the disclaimer and date correctly inserted. Any suggestions? here's the code: ********* Const Proprietary1 = "&8This string length is exactly 43 characters" Const Proprietary2 = "The second line string length is much longer at 68 text characters--" With ActiveSheet.PageSetup .LeftFooter = "" .CenterFooter = Proprietary & Chr(13) & Export .RightFooter = Date end with |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One more bit of information - the page layout is landscape mode.
On Monday, April 2, 2018 at 10:31:51 AM UTC-4, wrote: I am running Excel v14 in MS Office 2010. I have a routine that puts a two line disclaimer into the footer of each tab in the workbook. The routine also inserts the date in the right hand side of the footer. If I put the disclaimer and date in manually, no issues. If I insert the same disclaimer via code, the second line of the disclaimer truncates the last six characters of the string. If I leave the date out of the code, it works perfectly. The disclaimer does not bust the 255 character limit. The first line is 43 characters; the second is 68. So, I need to have both the disclaimer and date correctly inserted. Any suggestions? here's the code: ********* Const Proprietary1 = "&8This string length is exactly 43 characters" Const Proprietary2 = "The second line string length is much longer at 68 text characters--" With ActiveSheet.PageSetup .LeftFooter = "" .CenterFooter = Proprietary & Chr(13) & Export .RightFooter = Date end with |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What happens when you move the disclaimer to LeftFooter?
.LeftFooter = Proprietary & vbLf & Export .RightFooter = Date -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tried your suggestion. The result is the last character of the Proprietary2 string is truncated.
On Monday, April 2, 2018 at 10:31:51 AM UTC-4, wrote: I am running Excel v14 in MS Office 2010. I have a routine that puts a two line disclaimer into the footer of each tab in the workbook. The routine also inserts the date in the right hand side of the footer. If I put the disclaimer and date in manually, no issues. If I insert the same disclaimer via code, the second line of the disclaimer truncates the last six characters of the string. If I leave the date out of the code, it works perfectly. The disclaimer does not bust the 255 character limit. The first line is 43 characters; the second is 68. So, I need to have both the disclaimer and date correctly inserted. Any suggestions? here's the code: ********* Const Proprietary1 = "&8This string length is exactly 43 characters" Const Proprietary2 = "The second line string length is much longer at 68 text characters--" With ActiveSheet.PageSetup .LeftFooter = "" .CenterFooter = Proprietary & Chr(13) & Export .RightFooter = Date end with |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Am Tue, 3 Apr 2018 05:46:17 -0700 (PDT) schrieb : Tried your suggestion. The result is the last character of the Proprietary2 string is truncated. reduce the font size to 7 Regards Claus B. -- Windows10 Office 2016 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Claus,
Changing font size has no effect - it still truncates the last 6 characters of the second string at font size 6, 7, 8, etc... On Tuesday, April 3, 2018 at 9:13:38 AM UTC-4, Claus Busch wrote: Hi, Am Tue, 3 Apr 2018 05:46:17 -0700 (PDT) schrieb : Tried your suggestion. The result is the last character of the Proprietary2 string is truncated. reduce the font size to 7 Regards Claus B. -- Windows10 Office 2016 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Am Tue, 3 Apr 2018 09:46:56 -0700 (PDT) schrieb : Changing font size has no effect - it still truncates the last 6 characters of the second string at font size 6, 7, 8, etc... the number of characters is not only restricted to 255. It is also dependent of the font and the font size. If font size has no effect try another font. Regards Claus B. -- Windows10 Office 2016 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Claus,
Changing font size has no effect - it still truncates the last 6 characters of the second string at font size 6, 7, 8, etc... On Tuesday, April 3, 2018 at 9:13:38 AM UTC-4, Claus Busch wrote: Hi, Am Tue, 3 Apr 2018 05:46:17 -0700 (PDT) schrieb : Tried your suggestion. The result is the last character of the Proprietary2 string is truncated. reduce the font size to 7 Regards Claus B. -- Windows10 Office 2016 Just following Claus' suggestion about font size, I set up a sheet as follows: LeftHeader: &[Date] CenterHeader: "This string length is exactly 48 characters long" & vbLf & "The second line string length is much longer at 70 text characters long" The total length is 120 characters; The default font Calibri Regular 8pt is used; Screen res is 1920x1080 at 125% DPI; Paper orientation is Landscape; PrintPreview shows the entire footer content. I suspect your header will print as expected, but your screen res won't show that if the page is shrunk to fit your screen. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's my code...
Sub SetFooter() With ActiveSheet.PageSetup .RightFooter = "&D" .CenterFooter = "This string length is exactly 48 characters long" & vbLf _ & "The second line string length is much longer at 70 text characters long" End With End Sub -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Garry,
I had the same code as what you have listed below in a formatting subroutine which formats the page and the footer. I moved this code into a separate sub called from the formatting sub, and it works! It makes no sense to me why this is so, but I'm grateful Art |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Garry,
I had the same code as what you have listed below in a formatting subroutine which formats the page and the footer. I moved this code into a separate sub called from the formatting sub, and it works! It makes no sense to me why this is so, but I'm grateful Art You're most welcome! I appreciate the feedback; glad to help... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Circumventing the 255 character header/footer limit | Excel Worksheet Functions | |||
Text box character limit issue | Excel Worksheet Functions | |||
Character limit in an Excel Row | Excel Worksheet Functions | |||
Is it possible to add a 650 character footer in Excel? | Excel Programming | |||
Footer character limit | Excel Programming |