underpressure
Board Regular
- Joined
- Nov 24, 2012
- Messages
- 141
TextBoxes 4 thru 21 require a numeric value to properly process the procedure.
Instead of inserting 18 instances of this code, how can it be written to loop thru the 18 textboxes and set focus on the appropriate TextBox?
Even better, MsgBox would indicate the missing value (i.e.: "Value Required for #6")
Instead of inserting 18 instances of this code, how can it be written to loop thru the 18 textboxes and set focus on the appropriate TextBox?
Even better, MsgBox would indicate the missing value (i.e.: "Value Required for #6")
Code:
If TextBox4.Value = "" Then
TextBox4.SetFocus
MsgBox "Value Required", vbExclamation
Exit Sub
End If
If TextBox5.Value = "" Then
TextBox5.SetFocus
MsgBox "Value Required", vbExclamation
Exit Sub
End If
‘etc
‘etc