viewer code for a protected worksheet

George T

New Member
Joined
May 19, 2009
Messages
46
I needs is this viewer code to work in a sheet this is protected. I have certain columns that are protected and other columns user can modify. column C is unprotected and column A is unprotected.


Private Sub Worksheet_Change(ByVal Target As Range)

' Automatically place date/time stamp in cells A12:A120 when a cell in C12:C120 is manually updated
If Not Intersect(Target, Range("C12:C120")) Is Nothing Then
Target.Offset(0, -2) = Now
End If

End Sub
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Then you will have to add VBA code to that script that when the condition is met, it will unprotect the worksheet temporary so it can update the value in column A, then re-protect it afterwards to lock it again.

You should be able to get the code needed to protect/unprotect your worksheet by turning on the Macro Recorder and record yourself performing those steps manually.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,777
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top