LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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??

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
รง(User Entry)รจ can any one explain this pete the greek Excel Discussion (Misc queries) 1 October 17th 09 09:51 PM
Validation list that also allows user entry? Angela Dennis 911 Excel Worksheet Functions 6 July 20th 06 02:33 PM
User proofing an entry L.White Excel Programming 1 August 8th 05 02:51 PM
Msg Box - User Entry Validation ACase Excel Programming 1 August 5th 05 08:48 PM
Forcing Correction of User Input Errors Bob Kaku Excel Programming 0 September 14th 03 03:02 AM


All times are GMT +1. The time now is 06:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ฉ2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"