I am using the standard BetAngel_1 workbook that links BetFair race details directly into a spreadsheet via Bet Angel
I also have 2 other sheets that generate other criteria
My problem is that I have an event change macro in the BetAngel_1 sheet that is supposed to clear a range of cells if K1 changes. K1 is a countdown marker that starts at 0 then changes to 1, 2, 3, etc. up to 17
K1 is linked to a cell in one of the other sheets, eg. =Bet!$B$3
Event code is
----------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = [K1] Then
Range("O9").ClearContents
Range("O11").ClearContents
Range("O13").ClearContents
Range("O15").ClearContents
Range("O17").ClearContents
Range("O19").ClearContents
Range("O21").ClearContents
Range("O23").ClearContents
Range("O25").ClearContents
End If
Application.EnableEvents = True
End Sub
-------------------------------------------------
But it is not working presumably because the Event macro is only triggered when a user changes a cell but not when the value is the result is a formula calculation. However it should work if the result is from VBA code
So my question is how can I change cell k1 to be VBA code
Thanks in advance
I also have 2 other sheets that generate other criteria
My problem is that I have an event change macro in the BetAngel_1 sheet that is supposed to clear a range of cells if K1 changes. K1 is a countdown marker that starts at 0 then changes to 1, 2, 3, etc. up to 17
K1 is linked to a cell in one of the other sheets, eg. =Bet!$B$3
Event code is
----------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = [K1] Then
Range("O9").ClearContents
Range("O11").ClearContents
Range("O13").ClearContents
Range("O15").ClearContents
Range("O17").ClearContents
Range("O19").ClearContents
Range("O21").ClearContents
Range("O23").ClearContents
Range("O25").ClearContents
End If
Application.EnableEvents = True
End Sub
-------------------------------------------------
But it is not working presumably because the Event macro is only triggered when a user changes a cell but not when the value is the result is a formula calculation. However it should work if the result is from VBA code
So my question is how can I change cell k1 to be VBA code
Thanks in advance