Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
User entry correction
Hi
I have a userform with a textbox to enter a formula. The user is required to enter a formula as in the following examples X1+3*X 5+X1 X1+X2-10*X3+4 and so on I want to make sure that the user enters the correct format. This would include: 1 €“ enter only X values 2 €“ X are in upper case 3 - asterix between the number and X (eg 5*X1) This is what I have done so far -------------------------------------------------------------------------------------- Dim PointToX As Single, PointToAsterix As Single StrFunction = txtFunction.Text StrFunction = Replace(StrFunction, "x", "X") StrFunction = Replace(StrFunction, " ", "") PointToX = InStr(1, StrFunction, "X") 'First "X" occurrence If PointToX = 0 Then GoTo FunctionInputError Else FunctionInputError: txtFunction.Text.SetFocus txtFunction.Text.SelStart = 1 txtFunction.Text.SelLength = Len(txtFunction.Text) Exit Sub End Sub Any help?? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
User entry correction
I FORGOT TO SAY THAT THE USER MAY ALSO ENTER IN THIS FORM
X1*X2+3*X2*X4 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ç(User Entry)è can any one explain this | Excel Discussion (Misc queries) | |||
Validation list that also allows user entry? | Excel Worksheet Functions | |||
User proofing an entry | Excel Programming | |||
Msg Box - User Entry Validation | Excel Programming | |||
Forcing Correction of User Input Errors | Excel Programming |