Hi,
I am trying to trigger Macros according to the value cell A2 of Sheet1 is changed to. After changing the value in A2 nothing seems to be happening. What am I missing? Cell A2 is merged with everything up to cell B7, but I have also tried without the cell being merged.
I am trying to trigger Macros according to the value cell A2 of Sheet1 is changed to. After changing the value in A2 nothing seems to be happening. What am I missing? Cell A2 is merged with everything up to cell B7, but I have also tried without the cell being merged.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Sheets("Sheet1").Range("A2")) Is Nothing Then
If Target.Cells.Value = " " Or IsEmpty(Target) Then Exit Sub
If Target.Value = "1" Then Call Athlete1
If Target.Value = "2" Then Call Athlete2
End If
End Sub
Sub Athlete1()
At1 = ThisWorkbook.Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row + 1
ThisWorkbook.Sheets("Sheet2").Cells(At1, 1) = Time
End Sub
Sub Athlete2()
At2 = ThisWorkbook.Sheets("Sheet2").Cells(Rows.Count, 2).End(xlUp).Row + 1
ThisWorkbook.Sheets("Sheet2").Cells(At2, 2) = Time
End Sub
End Sub