I've set up a VBA code that sets up a form for the user to fill out information. I've set up another VBA code that runs upon sheet calculation that runs some checks and corrections to any information that is out of line. As soon as the second code runs all sheet calculation stops and I can only edit the first unlocked cell, even when sheet protection is off and I have selected another cell. All typing goes to the first unlocked cell.
This script has worked when triggered by selection change or by running the script manually. I've searched the internet but all I find are list of settings (all of which I have checked).
Private Sub Worksheet_Calculate()
'Transfer
'
If Range("AAA1").Value = "Transfer" And Range("AAB1").Value = "Not Empty" Then
If Range("D3").Value = "0" Or Range("D3").Value = "" Then
Range("AAB1").Value = "Empty"
End If
End If
If Range("AAA1").Value = "Transfer" And Range("AAB1").Value = "Empty" Then
If Range("E3").Value = Empty Or Range("F3").Value = Empty Then
Else
Range("D3").Value = Range("AA3").Value
Range("AAB1").Value = "Not Empty"
End If
End If
If Range("D3").Value > Range("AA3").Value And Range("AAA1").Value = "Transfer" Then
Range("D3").Value = Range("AA3").Value
End If
End Sub
The expected result is for cell D3's value to be automatically set to the max value (calculated in cell AA3 using the value in cell E3) when both cells E3 and F3 have been filled out and cell D3 is either empty or equal to zero. I use cell AAB1 as a "switch" so that the user can enter a custom amount without a hasle. Cell AAA1 is set by the first macro that sets up the form. It all works once. Then I encounter the problem described above.