How to Hide Formulas from Other Users in Excel (2 Ways)

Method 1 – Hide Formulas From Other Users Using Protection On Entire Sheet

Step 1 – Make sure your worksheet is in a lock state.

  • Check your Formula Bar and ensure that your formulas in the Formula Bar are showing properly.

Hide Formulas From Other Users Using Protection On Entire Sheet

  • Select the entire worksheet by pressing the Select All button(left corner most button in the worksheet).

Hide Formulas From Other Users Using Protection On Entire Sheet

  • Go to Format in the Home tab and click on Format Cell.

  • On the format page, you need to go to the Protection tab, if the locked option is unchecked, toggle to check.

  • If both of the options are being checked, then uncheck it. Go through step 2 again.

  • Go to the Protection tab, check both the Locked and Hidden boxes and press


Step 2 – Hide Formula In Excel Worksheet Using Protect Sheet Option

  • From the Home tab, go to Format.
  • Select the dropdown menu and select the Protect Sheet option.

Hide Formulas From Other Users Using Protection On Entire Sheet

  • After selecting Protecting Sheet, there should be a dialog box like the one shown below should appear.
  • Check what you want to allow other users to do with your worksheet. In this case, just the first two boxes will be sufficient.
  • Enter your desired password and click on OK.
  • After entering your password, another dialog box will appear to confirm your password. After confirming, click on OK.

  • On confirming passwords, you will notice that formula bar in your worksheet will no longer show any formulas.


Method 2 – VBA to Hide Formulas from Other Users in Excel

Step 1: Launch the Visual Basic Editor from the Developer tab. If you don’t get the tab, you will have to enable it first.

  • Visual Basic can also be activated by pressing Alt + F11 on your keyboard.

VBA to Hide Formulas from Other Users in Excel

Step 2: After you launch the VBA editor, a new window will open.

  • In this new window, click Insert and click Module.

VBA to Hide Formulas from Other Users in Excel

Step 3: In the editor, enter the following code.

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

VBA to Hide Formulas from Other Users in Excel

Step 04: Close both the Module and the VBA editor.

Step 05: From the View tab, click the Macros command and select the  View Macros option.

VBA to Hide Formulas from Other Users in Excel

Step 6: In the new dialog box, select the macro that you created and click Run.

VBA to Hide Formulas from Other Users in Excel

On clicking Run, you no longer will see any formula in the Formula Bar.

VBA to Hide Formulas from Other Users in Excel

 

We can also check the Format tab for further confirmation. This grey unprotect sheet option verifies that our worksheet is protected.


Download Practice Workbook

Download the practice workbook and use the password 123456hideformula when asked.


Related Articles


<< Go Back to Hide Excel Formulas | Excel Formulas | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Rubayed Razib Suprov
Rubayed Razib Suprov

Rubayed Razib, holding a BSC degree in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, serves as a devoted member of the ExcelDemy project. He has contributed significantly by authoring numerous articles and showcasing proficiency in VBA. Razib efficiently automates Excel challenges using VBA macros and actively participates in the ExcelDemy forum, providing valuable solutions for user interface challenges. Apart from creating Excel tutorials, he is interested in Data Analysis with MS Excel,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo