Macro to Hide formulas in a worksheet


Hide formulas in the entire worksheet


Sub HideFormula()
Cells.Select
Selection.Locked = True
Selection.FormulaHidden = True
ActiveSheet.Protect Password:="Pass"
End Sub

Note: “Pass” is the password used for protecting the worksheet and can be replaced by the password of your choice.

Hide formulas in the selection


Sub HideFormula()
Selection.Locked = True
Selection.FormulaHidden = True
ActiveSheet.Protect Password:="Pass"
End Sub

How to use codes shared here?