Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formulas Aren't Automatically Updating When Cells Change chris Excel Discussion (Misc queries) 6 April 5th 23 02:51 PM
Hide and lock cell formulas without affecting Macro? Mike Excel Discussion (Misc queries) 4 May 23rd 08 11:53 PM
hide formulas but can edit on the same cells sara Charts and Charting in Excel 2 October 3rd 06 10:55 PM
Can u lock individual cells (those containing formulas) in an Exc. [email protected] Excel Discussion (Misc queries) 1 March 2nd 05 08:02 AM
How do I hide formulas in Excel cells? Rita Excel Discussion (Misc queries) 2 February 15th 05 08:55 PM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"