Further Challenges with Footers and automatic text wrapping

S

Sierk

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
 
S

Sierk

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top