Ok - Using Joe's code is a bad news/good news situation. I can put my cursor in the textbox and hit the change button and that textbox will change, (the "Enter" event - I think) but if the cursor is NOT in the textbox, then hitting the change button only changes one, not all four. It is always textbox25 that changes BTW. I should point out that since all the textboxes are part of one matrix, I will almost never want to change just one textbox at a time. I am posting the code in case I did something really stupid, but I don't think I did. I just took Joes' code and changed it for the textboxes that I was interested in.
BTW - and I don't know if this matters - but the textboxes (that I am interested in) are usually not changed by the user, they are changed by my code. The user puts in the initial matrix and the code calculates the inverse matrix and populates the textboxes.
Gene, "The Mortgage Man", Klein
Private Sub TextBox21_Change()
'UserForm module code, only!
myCtrlTB = "TextBox21"
End Sub
Private Sub TextBox22_Change()
'UserForm module code, only!
myCtrlTB = "TextBox22"
End Sub
Private Sub TextBox24_Change()
'UserForm module code, only!
myCtrlTB = "TextBox24"
End Sub
Private Sub TextBox25_Change()
'UserForm module code, only!
myCtrlTB = "TextBox25"
End Sub
Private Sub TextBox21_Enter()
'UserForm module code, only!
myCtrlTB = "TextBox21"
End Sub
Private Sub TextBox22_Enter()
'UserForm module code, only!
myCtrlTB = "TextBox22"
End Sub
Private Sub TextBox24_Enter()
'UserForm module code, only!
myCtrlTB = "TextBox24"
End Sub
Private Sub TextBox25_Enter()
'UserForm module code, only!
myCtrlTB = "TextBox25"
End Sub
Private Sub CommandButton1_Click()
'UserForm module code, only!
Dim myVal$, myNum$, myDenom$
Dim myNumLen%, myCnt%
Dim myValResult As Variant
Dim myTB As Control
On Error GoTo myOther
Set myTB = Controls.Item(myCtrlTB)
myVal = myTB.Value
myNumLen = Application.WorksheetFunction.Search("/", myVal)
myNum = Left(myVal, myNumLen - 1)
myCnt = Len(myVal)
myDenom = Right(myVal, myCnt - myNumLen)
myValResult = myNum / myDenom
myTB.Value = Application.WorksheetFunction.Text(myValResult, "#,##0.000")
GoTo myEnd
myOther:
On Error GoTo myErr
myVal = myTB.Value
myTB.Value = Application.WorksheetFunction.Text(myVal, "# ??/??")
GoTo myEnd
myErr:
MsgBox "Please Enter a number or fraction!", vbCritical + vbOKOnly, "Error with number!"
myEnd:
End Sub