+ Reply to Thread
Results 1 to 5 of 5

Create workbooks and worksheets

  1. #1
    Registered User
    Join Date
    05-13-2020
    Location
    india , delhi
    MS-Off Ver
    2016
    Posts
    11

    Create workbooks and worksheets

    I have data of 4 product categories (A,B,C,D) and code assigned to each item is preceding with category like 'A01', 'B02' .....

    Prepare a tool to create different workbooks for each product category and different sheets for each product code in the workbook .
    `
    Under the macro , I have to let the user dynamically select the sales data file .
    For each category , the macro should create different workbooks for eg. For category 'A' create a workbook 'A.xlsx'

    and within each category workbook create separate sheets for each code .
    And I have to include data corresponding to that particular product code .

    I have attached a sample data for reference

    Being new to VBA programming .... I require a little help on this


    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Create workbooks and worksheets

    Try
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-13-2020
    Location
    india , delhi
    MS-Off Ver
    2016
    Posts
    11

    Re: Create workbooks and worksheets

    Thank you jindon for such a quick response
    The above code works but I am not able to get different workbooks ...

    Here is the full problem statement -

    Prepare one tool to create different workbooks for each product category and
    different sheets of each product code in the category workbook.
    For eg: In the attached workbook, your data is distributed across 4 product
    categories (‘A’,’B’,’C’ and ’D’) and code assigned to each item is preceding with
    category like ‘A01’, ‘B02’, ‘C032’

    Tasks I have to perform :

    1. Create a new Macro Tool workbook in which you will be creating the
    macro. Ensure that you create a button in this file for the user to execute
    the desired macro
    2. Under the macro, first let the user dynamically select the Sales data file.
    3. For each category, the macro then should create different workbooks. For
    eg: For category ‘A’ create a workbook ‘A.xlsx’ These workbooks should be
    saved at the same location as the Macro Tool workbook that you are
    creating.
    4. Within each category workbook, create separate sheets for each A code
    (like A01, A02, etc) These sheets should be named as per the code.
    5. Within each of the worksheets, include data corresponding to that
    particular product code
    6. Ensure that at the end, except the Macro Tool workbook, all other
    workbooks are closed.

    Thanks again

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Create workbooks and worksheets

    The code should do exactly what you said above except the button.

  5. #5
    Registered User
    Join Date
    05-13-2020
    Location
    india , delhi
    MS-Off Ver
    2016
    Posts
    11

    Re: Create workbooks and worksheets

    Yes Got it ...
    Thanks a lot !

+ 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: 0
    Last Post: 03-14-2019, 12:02 AM
  2. Replies: 0
    Last Post: 03-05-2019, 05:24 PM
  3. Using Autofilter values to create new worksheets or workbooks
    By Mancolt in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 06-02-2014, 01:47 PM
  4. [SOLVED] Create single worksheet from multiple workbooks with 4 worksheets in each workbook
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2013, 03:35 AM
  5. Create new workbooks and worksheets from an existing Workbook
    By nazmul in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-30-2008, 11:07 PM
  6. Auto Create workbooks and worksheets per columnar data
    By Rookie_User in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-31-2006, 04:28 PM
  7. Create workbooks from worksheets
    By Ian in Ankara in forum Excel General
    Replies: 3
    Last Post: 02-28-2006, 11:40 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