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.
Download Practice Workbook
We can use 3 different methods to generate sheet name code in the footer. We will see the use of the Insert and Page Layout tab and also use a VBA code in this post.
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.
- 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.
- Finally, just click outside that cell and we will see the sheet name footer is added.
Here, our sheet name is Insert Tab, that’s shown through the sheet name code in the footer.
Read More: Search Sheet Name with VBA in Excel (3 Examples)
Similar Readings
- Add Header in Excel (5 Quick Methods)
- Select Sheet by Variable Name with VBA in Excel (2 Ways)
- How to Hide Header and Footer in Excel (2 Easy Methods)
- Repeat Rows in Excel at Bottom (5 Easy Ways)
Another easy option is Page Setup.
Steps:
- At first, go to Page Layout from the ribbon and open the full set of page formatting options.
- As a result, a dialogue box will pop up and select Custom Footer.
- At this point, another dialogue box will pop up and we will select Left, Centre, or Right Section (We have chosen center) and Click Insert Sheet Name as shown in the image below.
- 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 Insert a Footer in Excel (2 Suitable Ways)
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.
- After that, copy and paste the VBA code below.
VBA code:
Sub sheet_name_Code_in_footer()
Dim Myworksheet As Worksheet
Set Myworksheet = Worksheets("VBA")
With Myworksheet.PageSetup
.CenterFooter = "&A"
End With
End Sub
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’ve applied the PageSetup method to place the footer in the center.
- After that, press the F5 or play button to run the code.
- Check if the footer is placed correctly by Page Set up option or press CTRL+P.
Read More: How to Edit Footer in Excel (3 Quick Methods)
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.
Conclusion
These are 3 different methods for Excel Sheet Name Code in 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
- How to Search Sheet Name in Excel Workbook (2 Methods)
- Insert Symbol in Excel Footer (3 Effective Ways)
- How to Get Excel Sheet Name (2 Methods)
- Insert Date in Footer in Excel (3 Ways)
- How to Rename Sheet in Excel (6 Easy and Quick Methods)
- Add The Footer Page 1 To The Current Worksheet
- Rename Sheet with VBA in Excel (Both Single and Multiple Sheets)