![]() |
Automatically lock cells and hide formulas
I'd like to set the cell format properties to "lock" and "hide" any formulas
entered into the cells and protect each sheet when my workbook is opened. |
Automatically lock cells and hide formulas
Something like the code below in the Workbook_open() event will do
Private Sub Workbook_Open() Dim wks As Worksheet For Each wks In Me.Worksheets With wks .Cells.Locked = True .Cells.FormulaHidden = True .Protect Password:="abcd" End With Next wks End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Qaspec" wrote in message ... I'd like to set the cell format properties to "lock" and "hide" any formulas entered into the cells and protect each sheet when my workbook is opened. |
Automatically lock cells and hide formulas
Look in help index for protection and then
Password protect a worksheet or workbook -- Don Guillett SalesAid Software "Qaspec" wrote in message ... I'd like to set the cell format properties to "lock" and "hide" any formulas entered into the cells and protect each sheet when my workbook is opened. |
Automatically lock cells and hide formulas
Thanks....my only problem is that this locks all cells. I would like to only
lock cells that contain formulas. If possible. "Nick Hodge" wrote: Something like the code below in the Workbook_open() event will do Private Sub Workbook_Open() Dim wks As Worksheet For Each wks In Me.Worksheets With wks .Cells.Locked = True .Cells.FormulaHidden = True .Protect Password:="abcd" End With Next wks End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Qaspec" wrote in message ... I'd like to set the cell format properties to "lock" and "hide" any formulas entered into the cells and protect each sheet when my workbook is opened. |
All times are GMT +1. The time now is 01:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com