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

Read More: How to Use Sheet Name Code in Excel (4 Applications)


Download Practice Workbook


3 Ways to Apply Sheet Name Code in Footer in Excel

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.


Method 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, that’s shown through the sheet name code in the footer.


Method 2: Sheet Name Code in Footer by Page Setup

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.

Excel sheet name code in footer by page set up

  • 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.

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.


Method 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.

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

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’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.

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


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

Mahbub
We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo