Hi all,
I am new to VBA and Macros.
I have two VBA codes that are triggered when an event occurs in my worksheet and want to combine them as one.
Now the problem is i dont know what structure it should take or what line to add/join the second code with the first code on the code window.
I use Office 365. I have attached the sample file which has the first code in the VBA window. The second code is pasted below.
Please help.
I am new to VBA and Macros.
I have two VBA codes that are triggered when an event occurs in my worksheet and want to combine them as one.
Now the problem is i dont know what structure it should take or what line to add/join the second code with the first code on the code window.
I use Office 365. I have attached the sample file which has the first code in the VBA window. The second code is pasted below.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Sheet2.Unprotect "123"
If VBA.IsEmpty(Target) Then
Target.Locked = False
Else
Target.Locked = True
End If
Sheet2.Protect "123"
End Sub
Please help.