+ Reply to Thread
Results 1 to 2 of 2

i want to displa msgbox only on error

Hybrid View

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    banglore
    MS-Off Ver
    Excel 2007
    Posts
    2

    i want to displa msgbox only on error

    hi i have query in VBA

    sub onerrr()
    on err goto err:
    {
    .....some code
    ......some code
    }
    err:
    msgbox "Contact for help"
    end sub()
    in this program i am trying to display that msgbox only if error occurs
    but it is displaying even if error is not there.. plz help me

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,973

    Re: i want to displa msgbox only on error

    You need to add:
    Exit Sub
    before the Err: line.
    Everyone who confuses correlation and causation ends up dead.

+ 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. [SOLVED] Need MsgBox in On Error
    By DAK266 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2013, 03:39 PM
  2. error with MsgBox
    By ramserp in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-10-2009, 06:39 AM
  3. msgbox appear with error msg
    By jrd269 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2005, 12:05 PM
  4. [SOLVED] msgbox on error
    By Ciara in forum Excel General
    Replies: 6
    Last Post: 05-26-2005, 05:15 PM
  5. [SOLVED] Remove time from a date and time field? Format removes the displa.
    By oaoboc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-16-2005, 03:35 PM

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