# How to Hide Formula in Excel Sheet (2 Methods)

Get FREE Advanced Excel Exercises with Solutions!

Letâ€™s consider a calculation that has multiple columns referenced with formulas. If one value tampers the whole calculation will be lost. To avoid such unnecessary tampering we need to make the formulas hidden. This article will show you how to hide formula in an Excel sheet.

## 2 Ways to Hide Formula in Excel Sheet

### 1. Hide Formula in Excel by Formatting Cells

Here, we have a dataset of ten different stores with their income, expenses, and profits. You have the formula in column E and that formula we want to hide from our Excel sheet.

Steps

• At first, you need to select the cells that have formulas you want to hide.

• At first, click the â€˜Homeâ€™Â tab.

• Then go to the Number group and click on the small titled arrow at the lower right of the group.

• After clicking the small titled arrow from the number group, the â€˜Format cellâ€™ dialog box opens up. Click the â€˜Protectionâ€™Â tab.

• By choosing theÂ â€˜Protectionâ€™ tab, click both Locked and HiddenÂ options.

• In the ribbon, you will find a â€˜Reviewâ€™ tab and click on it.

• After clicking the â€˜Reviewâ€™ tab, there is a â€˜Protectâ€™ group, click on the â€˜Protect Sheetâ€™ option.

• In the â€˜Protect Sheetâ€™ dialog box, you can either enter a password or leave it blank and click on â€˜OKâ€™.

• If you enter a password previously, you need to re-write this password to proceed and click on â€˜OKâ€™.

• After applying those steps you can protect your worksheet in such a way that if you click on a cell that has the formula, no formula would be shown in the formula bar.

### 2. Hide Formula in Excel with VBA Codes

Steps

• At first, you need to Select â€˜Alt+F11â€™ in order to run the VBA editor. If there is no Developer tab, you can adjust it by customizing the ribbon.
• After opening the VBA editor, click on â€˜Insertâ€™.

• From the â€˜Insertâ€™ tab, select â€˜Moduleâ€™.

• In the opened Module window, type the following VBA code:
``````Sub LockAndHideAllCellsWithFormulas()

With ActiveSheet
.Unprotect
.Cells.Locked = False
.Cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Cells.SpecialCells(xlCellTypeFormulas).FormulaHidden = True
.Protect AllowDeletingRows:=True
End With

End Sub``````

• Minimize the Module window and editor.
• Then click on the â€˜Viewâ€™ tab and go to the â€˜Macrosâ€™

• Select the given â€˜Macro Nameâ€™ and click â€˜Runâ€™.

• After using VBA codes you can protect your worksheet with the cell formula hidden.

## Conclusion

Both methods are practically proven to hide formula in Excel. For any kind of confusion, you can comment below and visit Exceldemy for further knowledge about Excel.

## Related Articles

#### Durjoy Paul

Hi there! I'm Durjoy. I have completed my graduation from the Bangladesh University of Engineering and Technology. I am working and doing research on Microsoft Excel and here I will be posting articles related to it.

We will be happy to hear your thoughts

Advanced Excel Exercises with Solutions PDF