How to Add Custom Footer Using Macros (VBA) in Excel Office 365?
Tags: addcustomfooterusing, vbamacros
Published: 2020-10-01 07:04:26

---
title: How to Add Custom Footer Using Macros (VBA) in Excel Office 365?
published: true
date: 2020-09-30 12:10:32 UTC
tags: AddCustomFooterUsing,VBAMacros
canonical_url: https://geekexcel.com/how-to-add-custom-footer-using-macros-vba-in-excel-office-365/
---

## Add Custom Footer Using Macros in Excel:

Here, we come up with the steps to **Add Custom Footer Using Macros 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 Custom Footer Using Macros:**

Follow the below steps to add a custom footer using macros in the spreadsheet.

- Go to 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-5.png)<figcaption id="caption-attachment-14839">Select Visual Basic option</figcaption>

- You need to activate the sheet where you want to **add a custom footer**.
- Kindly, **enter the below code**.

VBA code for Add custom footer using Macros in Excel

Sub AddCustomFooter()

Dim inputText As String inputText = InputBox(“Enter your text for the custom footer”, “Custom Footer”)

‘Add your custom text to the right footer

With ActiveSheet.PageSetup

.LeftFooter = ” “

.CenterFooter = ” “

.RightFooter = inputText

End With

End Sub

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

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

- You need 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-3.png)<figcaption id="caption-attachment-14841">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-7.png)<figcaption id="caption-attachment-14842">Macro dialog box</figcaption>

- Now, the **custom Footer dialog box** will open and you need to **enter the text** in the text box. Then, **click** the **OK** button.

![Custom Footer Dialoh Box](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Custom-Footer-Dialoh-Box.png)<figcaption id="caption-attachment-14843">Custom Footer Dialog Box</figcaption>

- Now, the specified text 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 result in the print preview window as shown in the below screenshot.

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

## **Verdict:**

In the above article, you can clearly understand the steps to **Add Custom Footer Using Macros in Excel Office 365** with an example. Drop your **feedback** in the comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!!

### See Also:

- [**Add Date in Header Using Macros in Excel **](https://geekexcel.com/how-to-add-date-in-header-using-macros-vba-in-excel-office-365/)
- [**Add Date in Footer Using Macros in Excel**](https://geekexcel.com/how-to-add-date-in-footer-using-macros-vba-in-excel-office-365/)