Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default protect formulas

Hi. Time for my daily question :) Thanks so much
everyone for helping me out on my other posts.

I am working to protect the formulas in my worksheet. If
possible, I want to be able to select cells with formulas
but not change them. I think its possible. (using excel
xp). This macro below tells me I don't have a variable
defined in the fourth line "for each c In Active...."

Any ideas?


Thanks,


Todd.



Sub ProtectFormula()
Dim Sh As Worksheet
Application.ScreenUpdating = False
For Each c In ActiveSheet.Cells 'in all worksheet
If c.Formula Like "=*" Then
c.Select
Selection.Locked = bLock
Selection.FormulaHidden = bLock
End If
Next c
End Sub
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default protect formulas

Todd,

Just set the Protection property of the cell to Locked and protect the
worksheet. I think XP has another way to protect cells, check it out.
Than password protect the worksheet.

But keep in mind that Excel protection is easy to break...

As for "c" - add Dim c as Range to your code.

--
sb
"Todd" <tunatl@hotmail wrote in message
...
Hi. Time for my daily question :) Thanks so much
everyone for helping me out on my other posts.

I am working to protect the formulas in my worksheet. If
possible, I want to be able to select cells with formulas
but not change them. I think its possible. (using excel
xp). This macro below tells me I don't have a variable
defined in the fourth line "for each c In Active...."

Any ideas?


Thanks,


Todd.



Sub ProtectFormula()
Dim Sh As Worksheet
Application.ScreenUpdating = False
For Each c In ActiveSheet.Cells 'in all worksheet
If c.Formula Like "=*" Then
c.Select
Selection.Locked = bLock
Selection.FormulaHidden = bLock
End If
Next c
End Sub
End Sub




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
Protect formulas during sort MMMM Excel Discussion (Misc queries) 2 March 6th 07 04:20 PM
Protect my formulas! VegasBurger Excel Worksheet Functions 4 June 14th 06 09:25 PM
Protect Formulas parteegolfer Excel Worksheet Functions 1 March 25th 06 02:09 AM
how to protect formulas in a cell Enrique Mahecha Excel Discussion (Misc queries) 4 December 27th 05 07:34 AM
protect a single row of formulas dalstar Excel Discussion (Misc queries) 3 May 20th 05 12:11 PM


All times are GMT +1. The time now is 11:54 AM.

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"