What I'm trying to learn to do is to use Case statements.
In the example below, (I don't know how close I was in the structure) my objective is to evaluate L9 based upon several conditions that will generate an error after the function has been calculated
. The conditions are L9 cannot be nonnumeric or a #VALUE! error is generated and L9 ≤ 0 ≥ or a #NUM! error is generated. I would like to be able evaluate L9 telling the user a value (s) is incorrect before the user goes to the next cell, if possible. Else I'm open for suggestions.
I don't know if I'm in the right event or if there needs to be two events - one for Worksheet_Change and another for Worksheet_Calculate.
Note, I only show one MsgBox in the code below. I would have to show a second one for the #NUM! error.
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Results
Case Is Range(“L9”).NumberFormat=
IF L9 returns a #Value! Error value
Msgbox(“Invalid value for Significance – must be numeric!”