FranklyPineapple
New Member
- Joined
- Jun 1, 2016
- Messages
- 2
Hi,
I have a series of IF functions, and if they all 4 of them return negatively I want it to run again. The first IF is based of a RANDBETWEEN function so it would give a different result, not resulting in a loop.
I have tried code such as
and
The first of which works, but only if I switch sheets then come back to the original sheet, it does not run automatically as I would like it to.
Any help would be welcome, thanks.
I have a series of IF functions, and if they all 4 of them return negatively I want it to run again. The first IF is based of a RANDBETWEEN function so it would give a different result, not resulting in a loop.
I have tried code such as
Code:
Sub Worksheet_Activate()
If (Worksheets("Sheet1").Cells(2, 23)) = 1 Then
ActiveSheet.EnableCalculation = False
ActiveSheet.EnableCalculation = True
Else
End If
End Sub
and
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If (Worksheets("Sheet1").Cells(2, 23)) = 1 Then
ActiveSheet.EnableCalculation = False
ActiveSheet.EnableCalculation = True
Else
End If
End Sub
The first of which works, but only if I switch sheets then come back to the original sheet, it does not run automatically as I would like it to.
Any help would be welcome, thanks.