+ Reply to Thread
Results 1 to 4 of 4

Use a macro to create new exceel files based on a range of cells

  1. #1
    Registered User
    Join Date
    07-16-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2013
    Posts
    4

    Use a macro to create new exceel files based on a range of cells

    Hi my name is Eugene,

    I have a template which I would like to save as a new file based on text typed in a range of cells, I have found similar macros but I don't know to much about macros and can't alter them to suit my application,

    In cell A1 to A100 of my master file I have a different part numbers entered as text, I would like a macro that looks at the contents of cell A1 and then create a new excel file in a location on my c drive (my documents) and then comes back and creates a 2nd new file that looks at the contents of cell A2 ..and repeats the process through to cell A100
    So in other words I would have a 100 new files with different names that has the contents of the original file. However the new files need to exclude the contents of cell A1-A100,

    Can anyone help with this?

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Use a macro to create new exceel files based on a range of cells

    Hi
    a couple of questions
    are the names of the new files the same as the cell contents in range a1:a100?
    and, by "exclude", do you mean the new files have nothing in range A1:A100?

  3. #3
    Registered User
    Join Date
    07-16-2013
    Location
    Brisbane
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Use a macro to create new exceel files based on a range of cells

    Hi

    Yep, you're onto it

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Use a macro to create new exceel files based on a range of cells

    ok try this
    it creates a list of all the values in cells A1:a100, clears that range, then saves the file with a new name each time based on those values.

    You should probably make sure your files are all saved and perhaps create a "test" subdirectory first to make sure it works properly.

    I have assumed you have added a "test" subdirectory to My Documents in the macro below. Remove this bit to copy directly into your main directory.

    I have also added ".xlsm" to the file name. Remove tihs is you already have this in your file names.

    Please Login or Register  to view this content.
    Last edited by NickyC; 07-16-2013 at 11:16 PM. Reason: typos

+ 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. [SOLVED] Macro needed to clear cells in range based on value of cells in another range
    By msmith7113 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2013, 12:32 AM
  2. Macro to create new sheet based on value in cells
    By vjboaz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2013, 01:02 AM
  3. How to create a dynamic table based on a range of cells
    By leviathan86 in forum Excel General
    Replies: 1
    Last Post: 01-09-2013, 03:59 PM
  4. Can Excel create suggestions based on a range of cells?
    By Philanalyst in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-04-2009, 07:50 PM
  5. Macro to create files based on month/year
    By Jon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2005, 04:25 PM

Tags for this Thread

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