ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Volitle (https://www.excelbanter.com/excel-programming/390193-volitle.html)

bw

Volitle
 
If someone Protects or Unprotects a worksheet, how does one "capture"
that fact so that I will know when to cause a manual Calculation?

--



Gary''s Student

Volitle
 
How about:

Sub bw()
Dim b As Boolean
b = ActiveSheet.ProtectContents
MsgBox (b)
If b Then
'do something
Else
'do something else
End If
End Sub

--
Gary''s Student - gsnu200724


"bw" wrote:

If someone Protects or Unprotects a worksheet, how does one "capture"
that fact so that I will know when to cause a manual Calculation?

--




bw

Volitle
 
I think you may be missing my point here. If you Protect or Unprotect
the worksheet (not using code), how will I know that you have done that?


"Gary''s Student" wrote in
message ...
How about:

Sub bw()
Dim b As Boolean
b = ActiveSheet.ProtectContents
MsgBox (b)
If b Then
'do something
Else
'do something else
End If
End Sub

--
Gary''s Student - gsnu200724


"bw" wrote:

If someone Protects or Unprotects a worksheet, how does one "capture"
that fact so that I will know when to cause a manual Calculation?

--





Gary''s Student

Volitle
 
The point is:

Suppose that I have arbitrarily protected or unprotected any worksheet
(either manually or via VBA) and then gave the worksheet to you. By running
the sub, you (or VBA) can detect what I have done.
--
Gary''s Student - gsnu200725

Dave Peterson

Volitle
 
There's no event that will fire when the user changes protection. The best you
can do is check it later--maybe with a _selectionchange event???

bw wrote:

If someone Protects or Unprotects a worksheet, how does one "capture"
that fact so that I will know when to cause a manual Calculation?

--


--

Dave Peterson

bw

Volitle
 
Thanks Dave,

There's no event that will fire when the user changes protection.

I suspected that what you said was true. Unfortunate...


"Dave Peterson" wrote in message
...
There's no event that will fire when the user changes protection. The
best you
can do is check it later--maybe with a _selectionchange event???

bw wrote:

If someone Protects or Unprotects a worksheet, how does one "capture"
that fact so that I will know when to cause a manual Calculation?

--


--

Dave Peterson




All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com