+ Reply to Thread
Results 1 to 13 of 13

index Match to reformat data

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    Savannah, GA
    MS-Off Ver
    Excel 2003 (work), 2010 (home)
    Posts
    44

    index Match to reformat data

    I have several trackers that production employees fill out daily, that are in an ugly format for data anaylsis, but is convenient for their daily use.

    I was wondering if someone could help me figure out a way to get the information into the format that I would like.

    I would like the data to show in columns:
    • Dates
    • Last Name
    • First Name
    • Quantity
    • Hours
    • Avg

    I am going to show the workbook, exactly as the Tracker is formatted, then there is an example of the format that I would like to get all the data.
    I was thinking, maybe I could have this "Final Format" sheet in each workbook, but I am not sure.

    Any ideas would be appreciated.

    Thanks,
    Staci
    Attached Files Attached Files
    Last edited by Staci; 03-27-2011 at 01:58 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: index Match to reformat data

    I would use a macro to create a new sheet and put the data into the correct format. Is that OK?

    Also your sample results should include a few more days. We need to see how your "results" would treat employees that are blank on a day, and where whole days have no data. Show us those results, too.
    Last edited by JBeaucaire; 03-13-2011 at 11:55 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: index Match to reformat data

    Staci,

    Detach/open workbook ReorgData w1 wF LR LC Count rng - Staci - EF768143 - SDG13.xls and run macro ReorgData.



    The below macro will clear and/or create worksheet Final Format.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Then run the ReorgData macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Registered User
    Join Date
    03-05-2011
    Location
    Savannah, GA
    MS-Off Ver
    Excel 2003 (work), 2010 (home)
    Posts
    44

    Re: index Match to reformat data

    I didnt even think about the possibility of a macro:

    @ Jb, it appears as though Stanleys macro performs the way I wanted. No information needed for days when no production is worked.

    Now a new issue: There are several worksheets that I will have to sort through in each workbook as shown here in this example:

    Tracker, Tracker2, Tracker 3.

    However the names are not Tracker in Real Life, How can I change the macro to include several worksheets?

    thanks for you assistance.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: index Match to reformat data

    Staci,

    Do you want the macro to work on all worksheets in your workbook?

    Or, just a selection of some of the worksheets? If so, what is the logic to just pick some of the worksheets? We could run the macro on all worksheets that begin with Tracker.

    Do you want the Final Format worksheet to include all the data from the other worksheets?

  6. #6
    Registered User
    Join Date
    03-05-2011
    Location
    Savannah, GA
    MS-Off Ver
    Excel 2003 (work), 2010 (home)
    Posts
    44

    Re: index Match to reformat data

    Do you want the macro to work on all worksheets in your workbook?
    No

    Or, just a selection of some of the worksheets?
    Yes

    If so, what is the logic to just pick some of the worksheets?
    still thinking about that one...lol

    We could run the macro on all worksheets that begin with Tracker.
    I could make this scenerio work and rename the worksheets to say "Trackerx", "Trackerxx", "Trackerxxx",etc.

    Do you want the Final Format worksheet to include all the data from the other worksheets?
    Trick Question: Well, Yes from all the worksheets that will start with Tracker

    Will this macro, just pull the information once or will it duplicate the data if the macro is reran? Meaning today I run the macro, it will format the data, how it is currently being done. Tomorrow I rerun the macro the only difference is it will basically reset worksheet "Final Format", and give me the current information, correct? If so that would be brilliant.

    Or will it duplicate the previous information, in addition to getting the current data? That would not be good.


    Thanks for you help!
    Last edited by Staci; 03-14-2011 at 08:56 PM.

  7. #7
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: index Match to reformat data

    Staci,


    Will this macro, just pull the information once or will it duplicate the data if the macro is reran? Meaning today I run the macro, it will format the data, how it is currently being done. Tomorrow I rerun the macro the only difference is it will basically reset worksheet "Final Format", and give me the current information, correct? If so that would be brilliant.

    OK, I will update the macro to include the additional Tracker??? worksheets in your last posted workbook.
    Last edited by stanleydgromjr; 03-14-2011 at 09:35 PM.

  8. #8
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: index Match to reformat data

    Staci,

    Detach/open workbook ReorgData multiple Tracker ws LR LC Count rng - Staci - EF768143 - SDG13.xls and run macro ReorgDataV2.
    Last edited by stanleydgromjr; 03-14-2011 at 11:16 PM.

  9. #9
    Registered User
    Join Date
    03-05-2011
    Location
    Savannah, GA
    MS-Off Ver
    Excel 2003 (work), 2010 (home)
    Posts
    44

    Re: index Match to reformat data

    Stanley one thing I forgot to include in my example, is after the month info, I have columns that combine the total, as shown in the example worksheet.

    Is there a way to eliminate it from going past the dates?
    So if it is March it would go to 3/31/2011, and if it is April it would go to 4/30/2011

    I highlighted the areas in the Final Format worksheet to show you.


    Thanks for your help, if needs be, I can work around this issue.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: index Match to reformat data

    Staci,


    The following will work correctly as long as the three additional columns Quantity, Hours, and Avg. are in each Tracker??? worksheet.



    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.




    Please Login or Register  to view this content.

    Then run the ReorgDataV3 macro.

  11. #11
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: index Match to reformat data

    Staci,

    The following will work correctly if your Tracker??? worksheets contain or do not contain, the three additional columns Quantity, Hours, and Avg. in row 3, or Total in row 2.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Then run the ReorgDataV4 macro.

  12. #12
    Registered User
    Join Date
    03-05-2011
    Location
    Savannah, GA
    MS-Off Ver
    Excel 2003 (work), 2010 (home)
    Posts
    44

    Re: index Match to reformat data

    Stanley, this is great and I really appreciate your assistance. I am having an issue in the real life workbook, and I can not recreate the issue in the sample workbook...not sure what to do there...so I am going to see if I can transfer all the data into the new format...and go from there.

  13. #13
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: index Match to reformat data

    Staci,

    Would you like to send me the actual file to look at?

    See my Private Message to you (top right hand corner of the Excel Forum, Welcome, Staci., Private Messages:

    I will have to post the the new code on the Excel Forum, but not the workbook if it contains sensative information.
    Last edited by stanleydgromjr; 03-19-2011 at 08:06 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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