+ Reply to Thread
Results 1 to 6 of 6

Transposing Rows/Columns with Calculations

  1. #1
    Registered User
    Join Date
    04-24-2016
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    3

    Transposing Rows/Columns with Calculations

    Hi Experts,

    I have only just started using MS Excel and need your expert advice on a transpose macro.
    The spreadsheet has a list of Material Codes along the columns (Mat 1 to Mat 3). Each of these is made up of a mix of material codes along the rows (MatA to MatC).

    % MatA MatB MatC Quantity
    Mat1 20 0 80 1000
    Mat2 50 50 0 2000
    Mat3 15 35 50 1000

    I need to transpose them into the format/result shown below. Basically, I need to get a column to row transpose while calculating the quantities based on the %.

    % Quantity
    123 ABC 20 200
    123 IJK 80 800
    456 ABC 50 1000
    456 DEF 50 1000
    789 ABC 15 150
    789 DEF 35 350
    789 IJK 50 500

    Please advise me on this. Thanks for all your help.

    Best Regards,
    Sol
    Last edited by sol79; 04-24-2016 at 08:22 PM.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Transposing Rows/Columns with Calculations

    Maybe :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-24-2016
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    3

    Re: Transposing Rows/Columns with Calculations

    This works perfectly. Thanks a million A couple of quick questions on the code:

    1. I've placed ActiveWorkbook.Worksheets.Add after the loop to add the results in a new tab. Where do I set the starting row for the new tab?
    2. I've tried moving the Quantity column by increasing the number of materials in the column. Your code works perfectly. So do you look for the last column and take the quantity from there?

    Thanks again. Really appreciate this.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Transposing Rows/Columns with Calculations

    You are welcome, thank for the rep. points.

    Please Login or Register  to view this content.
    - Where do I set the starting row for the new tab?
    I set the TargetCell by adding the green lines

    - So do you look for the last column and take the quantity from there?
    Yes

  5. #5
    Registered User
    Join Date
    04-24-2016
    Location
    Sydney
    MS-Off Ver
    2016
    Posts
    3

    Re: Transposing Rows/Columns with Calculations

    Excellent! Thanks again for all your help.

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Transposing Rows/Columns with Calculations

    You are welcome, glad I can help.


    Regards

+ 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. Need help transposing rows into columns
    By mckeven in forum Excel General
    Replies: 4
    Last Post: 10-08-2014, 04:41 PM
  2. [SOLVED] Transposing 2 - 70,000+ long columns into approx 4600 rows with 15 columns each
    By Glennstapo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2014, 09:51 AM
  3. Transposing records from rows to columns
    By Subtone in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-08-2013, 07:42 AM
  4. [SOLVED] Need help with transposing columns to rows
    By cheryl_granieri in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2013, 09:14 AM
  5. Replies: 8
    Last Post: 11-02-2011, 02:45 PM
  6. Transposing columns to rows
    By sunitagadapu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2009, 08:54 AM
  7. Transposing columns and rows
    By TEB2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2005, 01:06 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