Sorry All, it's working. No idea, I saved and closed, opened again and it works fine. No help required. Thanks
No Compile Error but code does not run when Invoked in Excel
Happy New Year All,
I am running a spreadsheet fed by an API, when certain conditions occur the values in the cells change and invoke the VBA. I am getting no compile or code errors from debug but the code does not execute when I enter the relevant values in the relevant cells
Struggling to understand why. Code as follows. Not very complex
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet: Set ws = Sheet1
Set Target = Range("BK1")
If ws.Range("BK1").Value = 10 Then
Application.EnableEvents = False
With Range("BC10:BC68").Copy
Range("BC10").PasteSpecial Paste:=xlPasteValues
End With
Range("BM1").Value = 1
Application.EnableEvents = True
End If
Set Target = Range("BK2")
If ws.Range("BK2").Value = 5 Then
Application.EnableEvents = False
With Range("BD10:BD68").Copy
Range("BD10").PasteSpecial Paste:=xlPasteValues
End With
Range("BM2").Value = 1
Application.EnableEvents = True
End If
Set Target = Range("BK3")
If ws.Range("BK3").Value = 105 Then
Application.EnableEvents = False
With Range("BE10:BE68").Copy
Range("BE10").PasteSpecial Paste:=xlPasteValues
End With
Range("BM3").Value = 1
Application.EnableEvents = True
End If
End Sub
Thanks
Jonathan