+ Reply to Thread
Results 1 to 3 of 3

Is it possible to put a customised message when error occur anywhere in USERFORM

  1. #1
    Registered User
    Join Date
    09-14-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    38

    Is it possible to put a customised message when error occur anywhere in USERFORM

    Dear all,

    I have a Vba UserForm with many textboxes and comboboxes

    when some error occurs anywhere through out the UserForm code then the userform throws error and on pressing end or debug, you will have to start from zero.

    I want solution like this:
    If error occurs at TextBox1 it will ignore that error and will go to TextBox2 and so on.

    I am using on Exit(ByVal Cancel As MSForms.ReturnBoolean) at some place. But it is not possible to identify what kind of error end user will make while using my UserForm

    So, I need a code at the top of UserForm Code which will operate when any error occur anywhere in code and allow user to go to next

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Is it possible to put a customised message when error occur anywhere in USERFORM

    Hi vatsalgos,

    You can use "On Error Resume Next" but I prefer to make the code of the UserForm more robust to eliminate the errors. Can you post a sample of your file which contains the UserForm to see the code & members can suggest some revisions to the code

  3. #3
    Registered User
    Join Date
    09-14-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    38

    Re: Is it possible to put a customised message when error occur anywhere in USERFORM

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    For full Userform there are about 50 such instances

    What happens is like this :
    If user accidentally enter the text in place of number in TextBox9110, obviously TextBox9111 will fail

    Such type of instances can be managed at each code, but I want few lines at the top by which UserForm will not close at the error

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Userform - Runt Time 380 Error Message
    By excelconditional in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2020, 02:03 PM
  2. Why this message occur after trying to save file
    By jack666sparrow in forum Excel General
    Replies: 1
    Last Post: 05-08-2015, 04:54 AM
  3. Userform returning an error message
    By hstarr2021 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2013, 06:32 PM
  4. [SOLVED] Date in userform error message not working
    By cath1509 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2013, 03:21 PM
  5. Creating and error Message Userform
    By fredlo2010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2013, 11:20 PM
  6. Customised userform for new, find & replace
    By Sean Thomas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2012, 06:24 PM
  7. UserForm with Error Message
    By 00Able in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2011, 04:52 AM

Tags for this Thread

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