+ Reply to Thread
Results 1 to 6 of 6

Macro to transpose data into row format

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    14

    Macro to transpose data into row format

    Hi,

    I am trying to create a macro that will transpose data in an excel file from column format into row format, the current column format has the 48 time slots for each half hour in a day running down in column C, I need to reshape the data so that the 48 times slots go across in the header row with a row for each day of data for the applicable category (M1, M2 etc.) per month, if that makes sense? I have attached an example file which shows the current format and the required format. If anyone is able to please help with VBA code that will automate this I would be very grateful.

    Many thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Macro to transpose data into row format

    This may not be the most efficent way

    But should give the desired outcome

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-07-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Macro to transpose data into row format

    Hi thank you very much for the code, I tested it out, it's very quick and almost works perfectly but for some reason it is only transposing the data from the category in column M2 and applies this same data to all the other categories. I have attached an example of the output, I tried to see which part of the code to change but I couldn't work it out which part to tweak?

    Thank you
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Macro to transpose data into row format

    see underlined code for updates.
    Have added 3 decimal format to data to make for ease of reading data

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-07-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Macro to transpose data into row format

    That's brilliant, it now transposes all data and thank you also for adding in the number formatting, this is much better on the eye.

    Really appreciate your help here.

    Thank you.

  6. #6
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Macro to transpose data into row format

    you're welcome.

+ 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 VBA Macro Assistance - Data in three columns, transpose to row format
    By matthewjberry in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2013, 11:50 AM
  2. [SOLVED] Macro to Transpose Data in Database Format
    By aathar in forum Excel General
    Replies: 16
    Last Post: 04-22-2013, 03:42 AM
  3. [SOLVED] How to transpose data in specific format from verious columns to Row
    By expl in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-12-2012, 04:11 PM
  4. Transpose data into a tabular format
    By fausto1234 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2012, 02:04 AM
  5. Macro to Transpose the data
    By pandyav in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-10-2010, 05:51 AM

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