Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Changing lines in the footer of Excel by VBA ???

I want to add a line to my footer in Excel... We try every commend we knew to change a line and we don't know what can make office change the line... Help me plz!

Here is the line i'm using...

ThisWorkbook.Worksheets("blablabla").PageSetup.RightFooter = "blablabla"

and i would like to add like the date on a different line in the Right footer. What is the command to make excel change line in the footer... We tryed directly in the page setup in the file menu but the character they put in is a little square but i don't know what this square refers to!?!

Thank you for your Help!

Hugo
0
TheCoyote
Asked:
TheCoyote
  • 3
  • 2
1 Solution
 
pauloaguiaCommented:
ThisWorkbook.Worksheets("blablabla").PageSetup.RightFooter = "blablabla"
 & vbLf & "&D"

You can find this by recording a macro of you doing so and then looking at the result.

Hope this helps

Paulo
0
 
pauloaguiaCommented:
By the way, vbLf is a constant that represents the Line Feed (newline) character. That's why this code produces a new line.

vbCr (carriage return) and vbCrLf have similar meanings although there are some differences between them.

Paulo
0
 
bruintjeCommented:
Hello TheCoyote,

not sure but you could try
ThisWorkbook.Worksheets("blablabla").PageSetup.RightFooter = "blablabla" & chr(13) & chr(10) & "blahblahblah2"

HAGD:O)Bruintje
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
TheCoyoteAuthor Commented:
WoW!!! you guys (or girls... =P ) are Fast Thank you very much!!

Hugo
0
 
TheCoyoteAuthor Commented:
Thank you for the fast answer it saves us lots of trouble!
Have a nice day!

Hugo
0
 
pauloaguiaCommented:
(We're guys).
Thanks for the points :)
And welcome to EE.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now