+ Reply to Thread
Results 1 to 2 of 2

Correct usage of On Error Resume Next to show msgbox

  1. #1
    Registered User
    Join Date
    07-29-2016
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    79

    Correct usage of On Error Resume Next to show msgbox

    Hello All,

    What's the correct way to use On Error Resume Next? What I'm trying to achieve is when the macro returns any error, it will show a message box. Sorry, I'm starting to learn VBA scripts recently on my own as much as possible, but I'm confused what's the correct way here.

    The message box line that i would like to incorporate is:

    MsgBox("Duplicate Name found", vbOKOnly, "File Finder")

    The Macro: What it does is generate a worksheet and name it based on a reference sheet. But if a worksheet name already exists and you try to generate it again, it will return an error. What I would like to get is instead of an error, the msgbox will appear instead.

    I'm trying to play with different placements of On error resume next to see if it will bypass the error, but no joy...

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    07-29-2016
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    79

    Re: Correct usage of On Error Resume Next to show msgbox

    Please Login or Register  to view this content.
    Yeah Finally it works!! Closing thread
    Last edited by mutzie; 01-20-2019 at 09:55 PM.

+ 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] VBA help needed to capture Error and Remove Pivot if error exist else resume
    By Tescatlipoca in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2014, 05:46 PM
  2. [SOLVED] how to add counter in msgbox to show remain times the message will show vba code
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2013, 06:46 AM
  3. [SOLVED] If Cell Value = Error, show MsgBox
    By pipoliveira in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2013, 05:12 AM
  4. Replies: 3
    Last Post: 05-17-2008, 05:25 AM
  5. [SOLVED] HELP: MsgBox takes 99% CPU usage... why?
    By Dhruba Bandopadhyay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2006, 08:30 AM
  6. [SOLVED] HELP: MsgBox takes 99% CPU usage... why?
    By Dhruba Bandopadhyay in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-22-2006, 08:30 AM
  7. [SOLVED] [SOLVED] HELP: MsgBox takes 99% CPU usage... why?
    By Dhruba Bandopadhyay in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 05-22-2006, 08:30 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