+ Reply to Thread
Results 1 to 3 of 3

IF Error Then Exit Macro Help!

  1. #1
    Registered User
    Join Date
    11-18-2005
    Posts
    4

    IF Error Then Exit Macro Help!

    I have a macro which deletes an existing worksheet (excel yes/no prompt appears) then creates a new worksheet with the same name as the one just deleted.

    If the macro is run but the user cancels the deletion of the existing worksheet, I get an error stating that excel can't name the new sheet the same as the existing one.

    I want to add an 'IF' statement to exit the macro if this happens, but I am unsure of the code that determines what was selected from the prompt (delete or cancel).

    This is my code:

    Please Login or Register  to view this content.
    Many Thanks

    Paul


  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,675
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-18-2005
    Posts
    4
    Cheers

    Worked like a charm!!!

    Paul


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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