I have 2 worksheet changes that need to be on the same worksheet. They work independently from each other. Separate they work fine; however I am not sure how to have them work on the same sheet. Is it possible to have two on the same worksheet?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim SBItotarget As Range
Set SBItotarget = Range("C5")
If Intersect(Target, SBItotarget) Is Nothing Then Exit Sub
If Not IsEmpty(SBItotarget) Then
ThisWorkbook.Connections("Query - MEMOLog").Refresh
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim celltotarget As Range
Dim celltodate As Range
Dim Cellstodate As Range
Dim UN As String
UN = Environ$("UserName")
Set celltotarget = Range("F20")
Set celltodate = Range("C20")
Set Cellstodate = Range("F22")
If Intersect(Target, celltotarget) Is Nothing Then Exit Sub
If celltodate.Value = "" Then
Sheets(Sheet1.Name).Unprotect Password:=""
celltodate.Value = Now
Cellstodate.Value = Now
Sheets(Sheet1.Name).Protect Password:=""
Private Sub Worksheet_Change(ByVal Target As Range)
Dim SBItotarget As Range
Set SBItotarget = Range("C5")
If Intersect(Target, SBItotarget) Is Nothing Then Exit Sub
If Not IsEmpty(SBItotarget) Then
ThisWorkbook.Connections("Query - MEMOLog").Refresh
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim celltotarget As Range
Dim celltodate As Range
Dim Cellstodate As Range
Dim UN As String
UN = Environ$("UserName")
Set celltotarget = Range("F20")
Set celltodate = Range("C20")
Set Cellstodate = Range("F22")
If Intersect(Target, celltotarget) Is Nothing Then Exit Sub
If celltodate.Value = "" Then
Sheets(Sheet1.Name).Unprotect Password:=""
celltodate.Value = Now
Cellstodate.Value = Now
Sheets(Sheet1.Name).Protect Password:=""