Results 1 to 4 of 4

After Error Message, I will not Proceed on the next TAB

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-09-2013
    Location
    Philippines, Manila
    MS-Off Ver
    Excel 2010
    Posts
    141

    After Error Message, I will not Proceed on the next TAB

    Hi Everyone,

    I have a TEXT box which I put a query that it should not be less than or more than 10 characters. And if it is less than or more than, a message box will appear.

    What I actually want is that the user will not able to proceed on the next Text Box.

    What am I missing on my codes? please help me

    Thank you

    Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    
    If Len(UserForm2.TextBox1.Value) < 10 Then
    
    MsgBox "Your Treaty Number is Incomplete, please correct!"
    UserForm2.TextBox1.SetFocus
    
    Else
    
    If Len(UserForm2.TextBox1.Value) > 10 Then
    
    TextBox1.Value = LEFT(TextBox1.Value, 5)
    MsgBox "Your Treaty Number exceeded 10 Characters, please correct!"
    UserForm2.TextBox1.SetFocus
    
    End If
    End If
    
    
    End Sub
    Last edited by Jarvin24; 07-03-2014 at 12:36 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to ignore and proceed on run time error 91
    By shammi_Raj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-02-2013, 01:44 PM
  2. An error message on open - a totally blank VBA message box
    By Mr_Tigas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2013, 11:29 AM
  3. Error Message For Function Procedure WITHOUT using a message box
    By bmr8002 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2012, 02:01 PM
  4. replace VBA run-time error message with custom message
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-14-2006, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1