View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
shades shades is offline
external usenet poster
 
Posts: 1
Default Macro to protect/hide formulae

Mike wrote:
(Apologies if this post appears twice: I first posted this a couple
of hours ago but it has not shown up - to me at least - as posted,
and I am keen to get this posted asap. I'm relatively new to this, so
apologies if I'm not following the 'rules' and frustrate people)


See my post above. It provides the solution to the first part. You can
then attach this macro to a button. Easiest way to do that is to go to
View Toolbars Forms

Then click on the button, and draw an object on the sheet. You can name
it whatever you want. Then select the button, right-click it and choose
"Assign macro" and the macro above will be listed. Then choose OK.

Try the button by clicking on it.

[Out of interest,
is it possible to have macros to reverse these operations?]



Yes, in the macro above, you can change the True statements to False.
To uprotect the sheets:


Code:
--------------------

Sub UnProtectAll()
Application.ScreenUpdating = False

ActiveWorkbook.Unprotect Password:="passowrd"

Dim ws As Worksheet

For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:="password"
Next ws
Application.ScreenUpdating = True

End Sub

--------------------


This should work for you.


---
Message posted from http://www.ExcelForum.com/