How to Apply Sheet Name Code in Footer in Excel (3 Ways)

Header and footer options are mostly used when we want to print our Excel document. We will guide you through several methods for the Excel sheet name code in the footer. For your better understanding, we are going to use a sample dataset containing Customer, Gender, Loan Purpose, Job, and Credit Risk.

Excel sheet name code in footer


How to Apply Sheet Name Code in Footer in Excel: 3 Ways

We can use 3 different ways to generate sheet name code in the footer. We will see the use of the Insert and Page Layout tab and VBA code in this article.


1. Sheet Name Code in Footer Using INSERT Tab

The most used option to add sheet names in the footer is using the INSERT tab.

Steps:

  • First, go to the INSERT tab and select Header & Footer from the Text options.

Excel sheet name code in footer Insert tab

  • Now, our sheet will look like the following image.

  • At this point, scroll down and we will find an option like Click to add Footer.
  • Here, we will click on that cell, then go to Design > Sheet Name.

Excel sheet name code in footer ribbon

  • Finally, just click outside that cell and we will see the sheet name footer is added.

Excel sheet name code in footer using insert tab

Here, our sheet name is Insert Tab, which is shown through the sheet name code in the footer.


2. Sheet Name Code in Footer by Page Setup

Another easy option is Page Setup.

Steps:

  • First, go to Page Layout from the ribbon and open the full set of page formatting options.

Excel sheet name code in footer by page set up

  • As a result, a dialogue box named Page Setup will pop up, and select Custom Footer.

  • At this point, another dialogue box will pop up named Footer.
  • We will get the Left, Centre, and Right sections.
  • We have chosen Center and clicked Insert Sheet Name as shown in the image below.

Excel sheet name code in footer using Page layout

  • After clicking OK, go to the Print Preview option to check whether the footer is visible or not.

We will see a preview like the following image.

Read More: How to Get Excel Sheet Name


3. Insert Sheet Name in Footer Using VBA

In our last method, we will see the use of VBA code to insert the footer in the sheet.

Steps:

  • First, right-click on the sheet and go to View Code.

Excel sheet name code in footer by macros

  • After that, copy and paste the VBA code below.
Sub sheet_name_Code_in_footer()

Dim Myworksheet As Worksheet

Set Myworksheet = Worksheets("VBA")
With Myworksheet.PageSetup
.CenterFooter = "&A"
End With

End Sub

Excel sheet name code in footer using vba

Here, we have declared a sub-procedure sheet_name_Code_in_footer, where we have used a worksheet object Myworksheet. Then, to the Myworksheet object, we applied the PageSetup method to place the footer in the center.

  • After that, press the F5 or click on the Run button to run the code.

Check if the footer is placed correctly by the Page Set up option or by pressing CTRL+P.


Practice Section

The single most crucial aspect in becoming accustomed to these quick approaches is practice. As a result, we’ve attached a practice workbook where you may practice these methods.

Excel sheet name code in footer


Download Practice Workbook


Conclusion

These are 3 different methods for Excel sheet name code in the footer. Based on your preferences, you may choose the best alternative. Please leave them in the comments area if you have any questions or feedback.


Related Articles


<< Go Back to Excel Sheet Name | Excel Worksheets | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Mahbubur Rahman
Mahbubur Rahman

MAHBUBUR RAHMAN is a leather engineer with a talent for Excel and a passion for VBA programming. To him, programming is like a time-saving wizard, making data manipulation, file handling, and internet interactions a breeze. His skill set extends to SPSS, STATA, Deep Neural Networks, and Machine Learning. Holding a B.Sc in Leather Engineering from Khulna University of Engineering & Technology, he's shifted to become a content developer. In this role, he crafts technical content centred around Excel... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo