+ Reply to Thread
Results 1 to 6 of 6

VBA loop to insert and delete worksheets in a specific sheet within a list

  1. #1
    Registered User
    Join Date
    11-07-2014
    Location
    Bloomington, IN
    MS-Off Ver
    MS Office 2013
    Posts
    3

    VBA loop to insert and delete worksheets in a specific sheet within a list

    I can't figure it out how to delete any worksheet that is not the specific sheet in a list, for example, column A's cells match the same names with worksheet's names; and how to insert a new worksheet for column A's cells on the list that does not currently have its own worksheet. Conditionally, the specific sheet won't be deleted. Please help. It gonna be loop for every cell in Column A.

  2. #2
    Forum Contributor
    Join Date
    08-17-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: VBA loop to insert and delete worksheets in a specific sheet within a list

    If I understood your query correctly then you have a list of worksheet name in Column A and you want to match them with worksheet name on same workbook..

    .if name doesn't exist but sheet exist then you want to delete that sheet and if name is available in column A and sheet doesn't then you want to create a worksheet with that name?

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA loop to insert and delete worksheets in a specific sheet within a list

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-07-2014
    Location
    Bloomington, IN
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: VBA loop to insert and delete worksheets in a specific sheet within a list

    Quote Originally Posted by BS Singh View Post
    If I understood your query correctly then you have a list of worksheet name in Column A and you want to match them with worksheet name on same workbook..

    .if name doesn't exist but sheet exist then you want to delete that sheet and if name is available in column A and sheet doesn't then you want to create a worksheet with that name?
    Yes, exactly.

  5. #5
    Registered User
    Join Date
    11-07-2014
    Location
    Bloomington, IN
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: VBA loop to insert and delete worksheets in a specific sheet within a list

    Quote Originally Posted by stnkynts View Post
    Please Login or Register  to view this content.
    Thank you so much. It works perfectly. But is it loop function?

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA loop to insert and delete worksheets in a specific sheet within a list

    But is it loop function?
    It incorporates 2 loops

+ 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. Loop to Delete worksheets stops after deleting one sheet...
    By booDaddy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2014, 05:12 PM
  2. Loop for adding specific worksheets in specific workbooks
    By pankaj8219 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2013, 10:22 AM
  3. [SOLVED] Loop through entire sheet, Insert row, copy row data, paste row data, delete row
    By Hyperdude in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2012, 01:46 AM
  4. insert/delete rows automatically to other worksheets when altering master list on sheet 1
    By whiskeycharlie77 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2012, 08:10 AM
  5. Do while loop to delete worksheets if worksheets are not in the specified list
    By kchm_2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2011, 03:02 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