Hi all,
Thanks for looking into this in advance ;
I have two VBA codes that alone works perfectly; however whenI add them both onto one sheet 2nd code doesnt work. Could someoneplease rewrite this so both can work?
This VBA stamps date and time in column C when entry in columnB is made
Private Sub Worksheet_Change(ByVal Target As Range)
IfTarget.Cells.Count > 1 Then Exit Sub
If NotIntersect(Target, Range("B2:B1000")) Is Nothing Then
With Target(1,2)
.Value = Now
End With
End If
End Sub
Where this one locks the cell in range when entry is made in columnsB to G -
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTojustenditall
Application.EnableEvents = False
If NotIntersect(Target, Range("B4:G1003")) Is Nothing Then
If Target.Value<> "" Then
ActiveSheet.UnprotectPassword:="justme"
Target.Locked = True
End If
End If
ActiveSheet.ProtectPassword:="justme"
justenditall:
Application.EnableEvents = True
End Sub
Thanks for looking into this in advance ;
I have two VBA codes that alone works perfectly; however whenI add them both onto one sheet 2nd code doesnt work. Could someoneplease rewrite this so both can work?
This VBA stamps date and time in column C when entry in columnB is made
Private Sub Worksheet_Change(ByVal Target As Range)
IfTarget.Cells.Count > 1 Then Exit Sub
If NotIntersect(Target, Range("B2:B1000")) Is Nothing Then
With Target(1,2)
.Value = Now
End With
End If
End Sub
Where this one locks the cell in range when entry is made in columnsB to G -
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTojustenditall
Application.EnableEvents = False
If NotIntersect(Target, Range("B4:G1003")) Is Nothing Then
If Target.Value<> "" Then
ActiveSheet.UnprotectPassword:="justme"
Target.Locked = True
End If
End If
ActiveSheet.ProtectPassword:="justme"
justenditall:
Application.EnableEvents = True
End Sub