+ Reply to Thread
Results 1 to 10 of 10

Create sheets based on cell data

  1. #1
    Registered User
    Join Date
    06-15-2016
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    9

    Create sheets based on cell data

    Hello

    This is my first post in this forum.

    I have an excel file with five worksheets, sheet "WBS" shows the sheets to be created. In this sheet there are about 150 lines with different names of any sheets that can be created. The rows that determines whether the sheet is to be created is A2: A150 where I want to mark with an "x" if it should create a new sheet. Then I want the newly created sheet to be named after column B (In Sheet "WBS"), where all the names is described. Every new sheet shall be copied with cell data from worksheet "TEMPLATE". The rows where "x" is selected may contain blank cells aswell.

    If possible, I want the macro to be dynamic so I can remove/add "x" in "WBS" and each time I run the macro it adds/removes sheets.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Create sheets based on cell data

    It is always easier to help and test possible solutions if we could work with your actual file. Perhaps you could upload a copy of your file to a free site such as www.box.com. or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Include a detailed explanation of what you would like to do referring to specific cells and worksheets. If the workbook contains confidential information, you could replace it with generic data.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-15-2016
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Create sheets based on cell data

    I have put a stripped file on https://dl.dropboxusercontent.com/u/.../Test_WBS.xlsm which is showing the correct worksheets that is mentioned in first post. Hope this is useful for further help on this matter!

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Create sheets based on cell data

    When you say
    Every new sheet shall be copied with cell data from worksheet "TEMPLATE".
    do you mean that you will first enter data into the TEMPLATE and then you want the TEMPLATE sheet copied with the added data and renamed according to column B in "WBS"? Also, can you clarify what you mean by
    The rows where "x" is selected may contain blank cells aswell.

  5. #5
    Registered User
    Join Date
    06-15-2016
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Create sheets based on cell data

    Quote Originally Posted by Mumps1 View Post
    When you say do you mean that you will first enter data into the TEMPLATE and then you want the TEMPLATE sheet copied with the added data and renamed according to column B in "WBS"?
    On this issue i mean that all raw data, as shown in TEMPLATE, shall be copied inte the new worksheets. After being copied I will then enter the missing data. No additional entries shall be entered in the TEMPLATE before copy!

    Quote Originally Posted by Mumps1 View Post
    Also, can you clarify what you mean by
    The rows where "x" is selected may contain blank cells aswell.
    I mean that not all cells in column A1:A150 shall be marked with an "x". Only cells with "x" shall be copied.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Create sheets based on cell data

    Try:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-15-2016
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Create sheets based on cell data

    Perfect, worked like a charm! Thank you for the help!

    Next step is to get the dynamic function working. If I remove a "x" in the list it should remov that worksheet and/or add a new if added a "x"

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Create sheets based on cell data

    Let's try a different approach to see if it works the way you want. Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your "WBS" sheet and click 'View Code'. Paste the macro into the empty code window that opens up.
    Please Login or Register  to view this content.
    Close the code window to return to your sheet. Place an 'x' in any cell in column A and exit the cell. The sheet will be created automatically. Next delete the 'x' and exit the cell and that sheet will be deleted.
    Last edited by Mumps1; 12-21-2016 at 03:37 PM.

  9. #9
    Registered User
    Join Date
    06-15-2016
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    9

    Re: Create sheets based on cell data

    Even better then the first macro.
    Thank you so much, an early christmas present!

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Create sheets based on cell data

    You are very welcome and Merry Christmas.

+ 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. Create sheets based on cell data
    By Spawn-Swe in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-20-2016, 09:49 AM
  2. create sheets based on cell values with corresponding data
    By VinodN in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-29-2016, 07:16 AM
  3. [SOLVED] VBA: Create new sheets based on cell value and copy data
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2015, 07:33 PM
  4. [SOLVED] Create sheets based on Cell A name
    By Christopherdj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-05-2015, 04:24 AM
  5. [SOLVED] Filter data on sheet1, create, and paste into new sheets based on cell value
    By minister in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2013, 09:16 PM
  6. Create pivot automatically in all the sheets based on the data in sheets
    By aravindhan_31 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2008, 11:59 AM
  7. [SOLVED] CREATE NEW WORKBOOK AND SHEETS BASED ON COLUMN DATA
    By control freak in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2006, 01:05 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