Creating timestamp and locking cells

briguy89

New Member
Joined
Jul 31, 2018
Messages
2
Hello all,

I am looking to trigger an event in column 1, which then creates a timestamp in column 2 and locks both column 1 and 2. Columns 3-7 will contain editable data, then column 8 will be for Status updates. When the status drop down box is selected to be "complete" I would like the entire row, cut and pasted to the next sheet. Any help is much appreciated.

If Target.column = 1 Then
Application.EnableEvents = False
confirm = MsgBox("Are you ready to start another entry?", vbYesNo, "Cell Lock Confirmation")
Select Case confirm
Case Is = vbYes
Dim cell As Range
With ActiveSheet
.Unprotect Password:="test"
.Cells.Locked = False
For Each cell In ActiveSheet.UsedRange
If cell.Value = "" Then
cell.Locked = False
Else
cell.Locked = True
Target.Offset(0, 1) = Format(Now(), "m/d/yyyy - h:mm:ss AM/PM")
End If
Next cell
.Protect Password:="test"
End With
Case Is = vbNo
Application.Undo
End Select
End If
Application.EnableEvents = True


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.column = 8 Then
If Target = "Complete" Then
Application.EnableEvents = False
nxtRow = Sheets("Completed").Range("H" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy _
Destination:=Sheets("Completed").Range("A" & nxtRow)
Target.EntireRow.Delete
End If
End If
Application.EnableEvents = True
End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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