How to Add Date in Footer Using Macros (VBA) in Excel Office 365?
Tags: adddateinfooterusing, vbamacros
Published: 2020-09-29 09:39:41

---
title: How to Add Date in Footer Using Macros (VBA) in Excel Office 365?
published: true
date: 2020-09-29 07:07:21 UTC
tags: AddDateinFooterUsing,VBAMacros
canonical_url: https://geekexcel.com/how-to-add-date-in-footer-using-macros-vba-in-excel-office-365/
---

## Add Date in Footer Using Macros:

In this tutorial, we will guide you to learn the steps to **Add Date in Footer Using Macros (VBA) in Excel Office 365** with an example. Get an official version of **MS Excel** from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)
## **Steps to Add Date in Footer Using Macros:**

If you want to insert the date in the footer of your spreadsheet, follow the below steps.

- On the **Developer Tab, select** the **Visual Basic** option under the **Code** section.

![Select Visual Basic option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Select-Visual-Basic-option-4.png)<figcaption id="caption-attachment-14755">Select Visual Basic option</figcaption>

- You need to activate the sheet where you want to add a date in the footer in Excel.
- Now, enter the below code.

VBA code for Add date in footer using Macros in Excel

Sub AddDateInFooter()

‘Here we are using the left-footer to show the date

With ActiveSheet.PageSetup

.LeftFooter = “&D”

.CenterFooter = ” “

.RightFooter = ” “

End With

ActiveWindow.View = xlNormalView

End Sub

- From the above code, **“&D”** represents the date value and **“LeftFooter, CenterFooter, RightFooter”** represents the position of the date in the footer section of the sheet.

- You need to **save the code** by selecting it. Then close the window.

![Save the Code](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Save-the-Code.png)<figcaption id="caption-attachment-14759">Save the Code</figcaption>

- You have to open the sheet containing the data. On the **Developer Tab, choose** the **Macros option** in the **Code** section.

![Choose the Macros option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Choose-the-Macros-option-2.png)<figcaption id="caption-attachment-14747">Choose the Macros option</figcaption>

- You need to make sure that your macro is selected and **click** the **Run** button.

![Macro dialog box](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Macro-dialog-box-6.png)<figcaption id="caption-attachment-14757">Macro dialog box</figcaption>

- Now, the date will be added to the footer of the spreadsheet.
- If you want to check whether it is added or not, go to the **File Tab, select** the  **Print ** option.

![Choose the File Tab](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Choose-the-File-Tab.png)<figcaption id="caption-attachment-14750">Choose the File Tab</figcaption>

- Now, you can see the date is added in the footer as shown in the below screenshot.

![Result](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Result-14.png)<figcaption id="caption-attachment-14758">Result</figcaption>

## **Conclusion:**

In this tutorial, we guided you to learn the steps to **Add Date in Footer Using Macros (VBA) in Excel Office 365** with an example. Share your **feedback** in the comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!!