+ Reply to Thread
Results 1 to 3 of 3

Rearrange data

  1. #1
    Registered User
    Join Date
    02-04-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    18

    Rearrange data

    I have a long list of parts with duplicates and each part can go to multiple units. I need to know how many parts to order for any given number of units.

    This is what some of my data looks like (it is a very long list):

    Please Login or Register  to view this content.

    This is what I want Excel to make it look like:

    Please Login or Register  to view this content.
    **Edit: So with the new output I know that if I want one of each unit, I need to order 4+6+3+7=20 Part 1's.
    Last edited by pdx-adm-trm01; 03-13-2014 at 04:49 PM. Reason: Clarification

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

    Re: Rearrange data

    pdx-adm-trm01,

    You are posting text.

    This means that if this was a problem where one needed to use your data, anyone trying to help you would have to enter the data manually. That makes no sense.

    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    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.

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

    Re: Rearrange data

    pdx-adm-trm01,

    Detach/open workbook ReorgData ScriptingDictionary aarray oarray - pdx-adm-trm01 - EF996484 - SDG17.xlsm and run the ReorgData macro.


    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
    2. Open your NEW 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
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel 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.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the ReorgData macro.

+ 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] Rearrange data with vba
    By ExcelMartin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-11-2013, 07:09 AM
  2. Rearrange Data
    By grandmastr in forum Excel General
    Replies: 6
    Last Post: 08-31-2010, 02:13 PM
  3. Rearrange Data
    By cutsygurl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2009, 12:44 PM
  4. Rearrange Data
    By kiddo7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2006, 06:16 PM
  5. Rearrange Data
    By smithbj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-19-2006, 12: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