+ Reply to Thread
Results 1 to 4 of 4

Using macro to create a new sheet if that sheet doesn't already exist

  1. #1
    Forum Contributor
    Join Date
    09-21-2007
    Posts
    196

    Using macro to create a new sheet if that sheet doesn't already exist

    I was hoping someone would be able to let me know if this is possible.

    I need a macro to create a new sheet with a specific name and put certain data on to it (this part I can write later)

    What I also need is for it not to create a new sheet (or do any of the rest of the macro) if that specific sheet name already exists e.g. can't run the same macro twice without deleting the sheet.

    E.g. Macro creates new sheet called "Dave" when run. If the workbook already contains the "Dave" worksheet then if the macro is run it gives an error message saying "Dave already exists" and rest of macro doesn't run.

    I hope this makes sense. Any help would be gratefully received

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Using macro to create a new sheet if that sheet doesn't already exist

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Using macro to create a new sheet if that sheet doesn't already exist

    Loop through sheets to see if sheet exists

    Please Login or Register  to view this content.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Using macro to create a new sheet if that sheet doesn't already exist

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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 to say use sheet B if sheet A doesn't exist
    By amajor99 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-14-2017, 03:56 PM
  2. [SOLVED] check column headers against sheet names if sheet not exist create it
    By AkaTrouble in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2015, 05:59 PM
  3. Create new directory if it doesn't exist and save sheet
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-01-2011, 01:47 PM
  4. Referencing a sheet that doesn't exist - yet
    By kosciosco in forum Excel General
    Replies: 1
    Last Post: 12-13-2007, 03:22 PM
  5. Create a new Sheet if it doesn't exist?
    By nbaj2k in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2006, 06:49 PM
  6. [SOLVED] VBA: Make a new sheet if it doesn't exist
    By PaulW in forum Excel General
    Replies: 2
    Last Post: 05-08-2006, 10:50 AM
  7. error when sheet doesn't exist...
    By Ctech in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-11-2005, 09:15 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