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