ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Footer word wrap (https://www.excelbanter.com/excel-programming/286133-footer-word-wrap.html)

Nathan Carroll

Footer word wrap
 
I have the following that works through a vb.net add-in

Private Sub btnAutoFooter_Click(ByVal Ctrl As Office.CommandBarButton, ByRef
CancelDefault As Boolean) Handles btnAutoFooter.Click
Dim wb As Excel.Workbook = Me.ExApp.ActiveWorkbook
Dim ws As Excel.Worksheet
For Each ws In wb.Worksheets
With ws.PageSetup
.RightFooter = "&8&""Arial,Regular""" & "&D Page &P of &N"
.LeftFooter = "&8&""Arial,Regular""" & wb.FullName & vbCrLf &
"Sheet:" & "&A"
.CenterFooter = ""
End With
Next
End Sub


I am trying to get the the line for the left footer to wrap. The vbcrlf and
vbnewline cause 2 returns not one. Is there some way to get only one?
Otherwise my sometime long filenames run all the way over into the right
footer.



Nathan Carroll

Footer word wrap
 
vblf

"Nathan Carroll" wrote in message
...
I have the following that works through a vb.net add-in

Private Sub btnAutoFooter_Click(ByVal Ctrl As Office.CommandBarButton,

ByRef
CancelDefault As Boolean) Handles btnAutoFooter.Click
Dim wb As Excel.Workbook = Me.ExApp.ActiveWorkbook
Dim ws As Excel.Worksheet
For Each ws In wb.Worksheets
With ws.PageSetup
.RightFooter = "&8&""Arial,Regular""" & "&D Page &P of &N"
.LeftFooter = "&8&""Arial,Regular""" & wb.FullName & vbCrLf &
"Sheet:" & "&A"
.CenterFooter = ""
End With
Next
End Sub


I am trying to get the the line for the left footer to wrap. The vbcrlf

and
vbnewline cause 2 returns not one. Is there some way to get only one?
Otherwise my sometime long filenames run all the way over into the right
footer.






All times are GMT +1. The time now is 12:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com