Results 1 to 2 of 2

Thread: Macro to create files as per the contents in a column

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    1
    Rep Power
    0

    Smile Macro to create files as per the contents in a column

    Hello,

    I want to create a macro which helps me create 4 separate files based on the data in column AG in one tab. In column AG there are 3 kinds of data as show below.

    1. Approved
    2. Current Code issue
    3. Old Code issue

    Before macro starts to create these files I want macro to do certain basic formatting checks:

    1. Macro should convert the contents in Column E to numbers (as some times numbers are saved in text format), I want the macro to change the format of the contents to number.

    2. Macro should check whether there are any duplicate values in column H, as there should not be any duplicate values in this column.

    a. If there are duplicate values the macro should give an error message "Duplicate Tracker ID found". And macro should stop proceeding further.
    b. If there are no duplicate values found the macro should proceed to next step.

    3. Macro should check whether the hours in Column AB are rounded to nearest 0.50.
    a. If there are odd decimal hours (which are not rounded to 0.5 or nearest round number). The macro should give an error message "Hours not rounded properly". And macro should stop proceeding further.
    b. If the hours are rounded properly the macro should proceed to next step.

    If all the above criteria's are fulfilled then the macro should proceed further to create the following 4 separate files as bellow.
    1. First file should include data related to the following data contained in column AG
    a. Approved
    b. Old Code Issue

    Save the file with the file name as "Current Hours"

    2. Second file should include the data related to the following data contained in column AG
    a. Approved
    b. Current Code Issue

    Save the file with the file name as "Approved Hours"

    3. Third file should include data related to the following data contained in column AG
    a. Current Code issue

    Save the file with the file name as "Current Code issue"

    4. Fourth file should include data related to the following data contained in column AG
    a. Old Code Issue.

    Save the file with the file name as "Old Code issue"

    Also the macro should prompt for selecting the folder to save these 4 files.

    Note: I want the macro to create all the four tabs in any case. (I.e even if any of the following values are not found in column AG, still the macro should create all the 4 files):

    1. Approved
    2. Current Code issue
    3. Old Code issue

    I have included the example files, for your easy reference.

    Example of Input file:

    1. Manager Approved Hours.xlsx

    Examples of desired final Output files created using the input file:
    1. Current Hours.xlsx
    2. Approved Hours.xlsx
    3. Current Code issue.xlsx
    4. Old Code issue.xlsx

    Thank you in advance for your help,

    Praveen B J
    Attached Files Attached Files

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    whoa! quite a request. More of a project request this than a help. You might want to try the hire developer section here Hire A Developer
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Macro To Close All CSV Files
    By Howardc in forum Excel Help
    Replies: 5
    Last Post: 03-15-2014, 05:24 PM
  2. Replies: 10
    Last Post: 05-23-2013, 12:30 PM
  3. Replies: 5
    Last Post: 01-12-2013, 02:49 AM
  4. Macro to copy data from a set of excel files
    By Sreejesh Menon in forum Excel Help
    Replies: 5
    Last Post: 11-15-2012, 11:17 AM
  5. Macro for Opening files and copy the contents of the File
    By ravichandavar in forum Excel Help
    Replies: 16
    Last Post: 08-15-2012, 09:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •