Forum Discussion

wayned6849's avatar
wayned6849
Copper Contributor
Dec 26, 2022
Solved

How to change date format in Excel footer

I am creating a template for a Spanish project.  In Spanish, the dates are formatted dd/mm/yyyy.   How can I change the format in my footer ?     The current entry  is:    Actualizado &[Date]    Thi...
  • wayned6849's avatar
    wayned6849
    Dec 26, 2022
    I finally found a way to do this! I'll post the information here for anyone else looking for a way to accomplish this. It is from this article.

    https://www.extendoffice.com/documents/excel/4266-excel-format-date-in-header.html

    I created a 3 line VB script:

    Sub add_date_footer()
    ActiveSheet.PageSetup.LeftFooter = Format(Date, "dd-mm-yyyy")
    End Sub

    When I ran it, it changed the date in my footer from mm/dd/yyyy to dd/mm/yyyy.

    Thanks for all the suggestions.

Resources