+ Reply to Thread
Results 1 to 2 of 2

If Sheet Exists Stop Macro from Creating a Copy

  1. #1
    Forum Contributor
    Join Date
    10-27-2005
    Posts
    177

    If Sheet Exists Stop Macro from Creating a Copy

    Hi everyone. I would really appreciate assistance on this.

    I have the following code that is part of a larger code:

    Please Login or Register  to view this content.
    This copies Sheet1 to the end and renames the copy to "SO".

    Is there a way to modify the code so that if someone tries to run the macro again and SO already exists, it just stops and doesn't create another copy of Sheet1?

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: If Sheet Exists Stop Macro from Creating a Copy

    Hi,

    Try this:
    Please Login or Register  to view this content.
    Note: if you simply want the code to resume as normal if the sheet already exists, then just remove the Else condition.

    I hope this helps
    Last edited by ajryan88; 03-04-2014 at 09:50 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. Replies: 1
    Last Post: 11-14-2013, 09:24 PM
  2. [SOLVED] Macro to Save file as PDF with Error to stop if name already exists
    By jan mason in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2013, 08:54 AM
  3. Macro to copy sheet from closed work book and overwrite if sheet already exists
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-23-2009, 06:36 PM
  4. Run Macro & Rename Sheet upon creating copy from blank.
    By Kervin Manasseh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2005, 07:05 AM
  5. [SOLVED] stop my speadsheet from creating an automatic backup copy
    By lggallo in forum Excel General
    Replies: 3
    Last Post: 05-18-2005, 05:06 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