+ Reply to Thread
Results 1 to 8 of 8

Macro to transpose and reformat for upload

  1. #1
    Forum Contributor
    Join Date
    10-05-2012
    Location
    Washington
    MS-Off Ver
    Excel 2013
    Posts
    106

    Macro to transpose and reformat for upload

    Right now I have an Excel spreadsheet I am using to plan some purchases. I am trying to figure out a way to take my planning sheet and reformat it so it can be uploaded into my system to auto generate POs. The way the sheet is laid out is that all my future dates are in columns going out 49 weeks. and each row is a separate supplier and part number with the quantities being purchased under the date columns. In order to upload it to my PO system I need one row for each date & quantity.

    Essentially I am trying to transpose the entire array but cant just use that formula because I loose visibility on the supplier. I have attached a workbook with some sample data. the "export" tab is how I am receiving the information and the "reformatted" tab is how I need it to be formatted for upload.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Macro to transpose and reformat for upload


    What means 'my system' and 'for upload' to where, what application, and how ?!
    Why your planning sheet is not well designed ?

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Macro to transpose and reformat for upload

    To normalize your data to the format you wish, unpivot your data with Power Query

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Macro to transpose and reformat for upload

    Hello.
    I leave you a solution that mixes a bit of Power Query and another of macros:

    PHP Code: 
    Sub Macro8()
    Range("'Export Format'!A1").CurrentRegion.Name "myData"
    With Sheets("Reformated").ListObjects(1)
      .
    QueryTable.Refresh BackgroundQuery:=False
      
    .Range.Columns.AutoFit
      Names
    ("myData").Delete
    End With
    End Sub 
    Attached Files Attached Files
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro to transpose and reformat for upload

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 04-11-2023 at 09:08 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Forum Contributor
    Join Date
    10-05-2012
    Location
    Washington
    MS-Off Ver
    Excel 2013
    Posts
    106

    Re: Macro to transpose and reformat for upload

    Thank you! this worked perfect.

  7. #7
    Forum Contributor
    Join Date
    10-05-2012
    Location
    Washington
    MS-Off Ver
    Excel 2013
    Posts
    106

    Re: Macro to transpose and reformat for upload

    Thanks. I have only started learning Power Query. what I have learned so far is great. I'll have to play around with this and see if I can get it to work.

  8. #8
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Macro to transpose and reformat for upload

    Quote Originally Posted by morbdetro View Post
    Thanks. I have only started learning Power Query. what I have learned so far is great. I'll have to play around with this and see if I can get it to work.
    It's a good decision and thank you very much for the +Rep.

+ 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. Macro to Reformat/transpose data into table style
    By antonio32 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2017, 08:29 AM
  2. Upload and transpose text file into excel sheet
    By HalPlz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2015, 02:45 AM
  3. reformat possibly transpose
    By nitroX in forum Excel General
    Replies: 5
    Last Post: 07-17-2015, 08:09 PM
  4. Need a macro that will disassemble a table and reformat it for upload
    By banditeb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-27-2014, 12:53 PM
  5. Unable to upload files to upload center
    By GeekoMania in forum Office 365
    Replies: 0
    Last Post: 09-11-2013, 03:18 AM
  6. [SOLVED] Reformat Macro
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2012, 12:19 PM
  7. [SOLVED] Reformat a worksheet using a macro
    By Andrew Hargreaves in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-11-2005, 01:06 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