AnsweredAssumed Answered

how to script  processbook VBA for the textbox?

Question asked by OhJunseo on Feb 4, 2018
Latest reply on Feb 5, 2018 by gregor

I'm beginner in VBA

The msgbox shows OK or BAD based on the value of 70.

I want to type in a text box and easily switch to another reference value except 70.

 

And I want to reduce the construction simply because it is more than 100 units.

I'd appreciate your help.

 

 

 

Private Sub Value1_DataUpdate()
If Value1.GetValue(Time, 1) > 70 Then
For i = 0 To 0
MsgBox "Unit1 OK"
Next
End If
End Sub

 

Private Sub Value2_DataUpdate()
If Value2.GetValue(Time, 1) < 70 Then
For i = 0 To 0
MsgBox "Unit1 BAD"
Next
End If
End Sub

 

Private Sub Value3_DataUpdate()
If Value3.GetValue(Time, 1) > 70 Then
For i = 0 To 0
MsgBox "Unit2 OK"
Next
End If
End Sub

 

Private Sub Value4_DataUpdate()
If Value4.GetValue(Time, 1) < 70 Then
For i = 0 To 0
MsgBox "Unit2 BAD"
Next
End If
End Sub

 

Private Sub Value5_DataUpdate()
If Value5.GetValue(Time, 1) > 70 Then
For i = 0 To 0
MsgBox "Unit3 OK"
Next
End If
End Sub

 

Private Sub Value6_DataUpdate()
If Value6.GetValue(Time, 1) < 70 Then
For i = 0 To 0
MsgBox "Unit3 BAD"
Next
End If
End Sub

Outcomes