London_Calling
Active Member
- Joined
- Feb 27, 2007
- Messages
- 256
I’ve got a few triggers set up on my worksheet that cause a cell/s to display ‘LAY’ when the criteria are met. When LAY is displayed a simple VBA code is initiated:
That’s all fine. But if I add a row (see below next), it causes the CPU to immediately jump to 100% and Excel freezes indefinitely:
Fwiw, the formula code also works fine when I trigger the LAY cells but don't initiate the VBA code.
Is my code wrong, perhaps (though there's no indication of a circular reference) ? Any suggestions and/or ideas gratefully received.
Cheers.
Code:
Private Sub Worksheet_Calculate()
If [CB5] = "LAY" Then
[S5] = [BG5]
[Q5] = "LAY"
End If
End Sub
That’s all fine. But if I add a row (see below next), it causes the CPU to immediately jump to 100% and Excel freezes indefinitely:
Code:
Private Sub Worksheet_Calculate()
If [CB5] = "LAY" Then
[S5] = [BG5]
[Q5] = "LAY"
End If
If [CB6] = "LAY" Then
[S6] = [BG6]
[Q6] = "LAY"
End If
End Sub
Is my code wrong, perhaps (though there's no indication of a circular reference) ? Any suggestions and/or ideas gratefully received.
Cheers.