How to Prevent From Changing Worksheet Name in Microsoft Excel?
Tags: topreventfromchangin, vbamacros
Published: 2021-09-23 09:54:04

---
title: How to Prevent From Changing Worksheet Name in Microsoft Excel?
published: true
date: 2021-09-21 09:47:47 UTC
tags: ToPreventFromChangin,VBAMacros
canonical_url: https://geekexcel.com/how-to-prevent-from-changing-worksheet-name-in-microsoft-excel/
---

In this article, you will learn how to **prevent changing Worksheet names** in Microsoft Excel using examples. Let’s see them below!! Get the 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)

## Example

- Firstly, you need to **create worksheet** contains **two sheets: Permanent & Temporary**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Two-Sheets.png)<figcaption>Two sheets</figcaption>

- In the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Sheet1.Name <> "Permanent" Then
    Sheet1.Name = "Permanent"
End If
End Sub

```

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

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code-64.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- After **copying the code** , if we try to **change the name of the Permanent sheet** , then Excel will not allow us.

## Verdict

From this chapter, you can get some clarification about how to **prevent changing Worksheet names** in Microsoft Excel. Let me know if you have any **doubts** regarding this article or any other Excel/VBA topic.

Thank you so much for visiting  **[Geek Excel](https://geekexcel.com/)!! **If you want to learn more helpful formulas, check out [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

**Related Articles:**

- **[Excel Formulas to Calculate the Cumulative Loan Principal Payments!!](https://geekexcel.com/excel-formulas-to-calculate-the-cumulative-loan-principal-payments/)**
- **[Formulas to Calculate the Interest for Given Period ~ Quickly!!](https://geekexcel.com/excel-formulas-to-calculate-the-interest-for-given-period/)**
- **[Excel Formulas to Calculate the Payment for a Loan ~ Useful Tricks!!](https://geekexcel.com/excel-formulas-to-calculate-the-payment-for-a-loan/)**
- **[Excel Formulas to Calculate Loan Interest in Given Year ~ Simple Tips!!](https://geekexcel.com/excel-formulas-to-calculate-loan-interest-in-given-year/)**
- **[How to use the CUMPRINC function in Excel Spreadsheet?](https://geekexcel.com/how-to-use-the-cumprinc-function-in-excel-spreadsheet/)**