ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Further Challenges with Footers and automatic text wrapping (https://www.excelbanter.com/excel-programming/422726-further-challenges-footers-automatic-text-wrapping.html)

Sierk

Further Challenges with Footers and automatic text wrapping
 
Everything is working with the exception of the final result. I have the
potential for some really long file paths and names. The problem is that the
three footer elements (leftfooter, centerfooter and rightfooter) are bottom
justified. All three are used as follows:

dd/mm/yyyy page
Company Name
Very long
file path and name.xls

If all three footer elements were top justified the problem would be solved.
I have tried adding carriage returns ( chr(13) ) in the left and center
footer which works. However I cannot tell how many lines my right footer is
going to be, 2 or 3. I have tried character counting but the combination of
flexible character width and automatic wrapping on a space and a dash only
make that idea very difficult to program. Any ideas? The code I have used
thusfar for setting the footer is as follows:

vFont = "&""Times New Roman,Regular""&8"
vFile = " &F"
vCR = Chr(13)
vCoName = "CompanyName"

' Assign date to left footer variable
vLeftFooter = vFont & "&D"
' Assign page number to center footer variable
vCenterFooter = vFont & "&P"
' Assign company name, carriage return and file path to right footer
variable
vRightFooter = vFont & vCoName & vCR & vPath & vFile

ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftFooter = vLeftFooter
.CenterFooter = vCenterFooter
.RightFooter = vRightFooter
End With


Sierk

Further Challenges with Footers and automatic text wrapping
 
The formatting of the three footer elements (leftfooter, centerfooter and
rightfooter) did not display properly. It should be as follows:

dd/mm/yyyy page Company Name
Very long file path and name.xls

Or:

Date - Top left,
Page No - Top Center
Company Name - Top Right
Very long file path and name.xls Right justified below Company Name



All times are GMT +1. The time now is 04:00 PM.

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