Checkbox for Time stamp and Lock cells

Ashwathmv

New Member
Joined
Jan 12, 2019
Messages
4
Hi,

I am looking for a help to create the checkbox. In the spreadheet column A1 to E1 has to be updated manually. Once the data is updated, i am looking to have a checkbox created in F column, if i tick the check box, first requirement is

1) cell A1 To E1 should get locked
2) in cell G1 tike stamp to be appeared
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
.
Use an ActiveX Checkbox control in F1.

Paste this in the Sheet1 module :

Code:
Option Explicit


Private Sub CheckBox1_Click()
    If CheckBox1.Value = True Then
        Sheets("Sheet1").Range("A1:E1").Locked = True
        Sheets("Sheet1").Range("G1").Value = Now
        Worksheets("Sheet1").Protect
    ElseIf CheckBox1.Value = False Then
        Worksheets("Sheet1").Unprotect
        Sheets("Sheet1").Range("A1:E1").Locked = False
        Sheets("Sheet1").Range("G1").Value = ""
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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