+ Reply to Thread
Results 1 to 11 of 11

Excel 2007 Transpose (Complicated)

  1. #1
    Registered User
    Join Date
    08-06-2013
    Location
    Texas, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Excel 2007 Transpose (Complicated)

    I have a very large dataset that takes up many sheets of several files. I am trying to automatically transpose the data from two of the many columns in the spreadsheet either with a function or using macros. The dataset contains record numbers in column C and estimated use in column L. There are up to 13 rows for each record, with the record number being repeated in each row. I would like to copy the record number (from column C) one time followed by the estimated use (from column L) transposed so the 13 records are next to the record number. I have attached an image of the sample file as well as an image of what I'm hoping the output file would look like.

    File1.GIFFile2.GIF

    Any help would be greatly appreciated! If further information is needed, please let me know.

    Thank you!

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Excel 2007 Transpose (Complicated)

    For quicker an better help on your question, please read the link below.

    http://www.excelforum.com/the-water-...-question.html
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel 2007 Transpose (Complicated)

    A gif is of least use to all the users here who want to help you.

    Attach a sample excel file instead -

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    08-06-2013
    Location
    Texas, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel 2007 Transpose (Complicated)

    Thank you both for your feedback. Sorry for not attaching a sample file from the start.

    The actual file very closely resembles this file, however I have limited the number of rows and sheets on the file. The actual file fills up all the rows (65536) of roughly 5 sheets. I have multiple files containing the data.
    SampleSheetAndOutput.xls

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel 2007 Transpose (Complicated)

    Try this code - also i have seen that at every first entry in column C, there is no asterisk " ' " before the number but the other numbers have it. This will cause wrong output in the macro. Any way you can fix those entries which do not have the asterisk before the numbers.
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  6. #6
    Registered User
    Join Date
    08-06-2013
    Location
    Texas, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel 2007 Transpose (Complicated)

    I get a compile error: Sub or Function not defined.

    For some reason I cannot add the " ' " before the first record number in any of the records... Would it be easier if I simply removed them all? I have a set of data that does not contain the " ' " on any record.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Excel 2007 Transpose (Complicated)

    Try this formulae approach

    1/. Your Records are stored as Text and in some cases preceded with an apostrophe, clean this up first.
    In this workbook I have removed all the apostrophes and converted the remainder to numbers
    The column is formatted Number Format > Custom Type:= 0000000000

    2/. Create a dynamic named range to keep the calculations to an absolute minimum
    Name:= Record
    Refers to:=
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    3/. Remove duplicates with ths array formula, confirm with Ctrl+Shift+Enter before dragging Down until blanks are returned.
    In A2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    4/. In B2 this array formula, again confirm with Ctrl+Shift+Enter before dragging Across and Down until blanks are returned.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This will be heavy on very large worksheets, VBa will be faster.

    Your Profile is 2007 but the workbook provided is 2003 or earlier this works with 2003, the description above gives the shorter 2007 formulae.
    Attached Files Attached Files
    Last edited by Marcol; 08-06-2013 at 12:29 PM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel 2007 Transpose (Complicated)

    Quote Originally Posted by martha3553 View Post
    I get a compile error: Sub or Function not defined.

    For some reason I cannot add the " ' " before the first record number in any of the records... Would it be easier if I simply removed them all? I have a set of data that does not contain the " ' " on any record.
    Sorry, i forgot to remove the "text" word in these lines. Please remove them and it should work.
    Please Login or Register  to view this content.
    Also, if you remove the " ' " for all, it will ensure your macro runs correctly. As long as all the data is consistent in format in column C, the macro will work.

  9. #9
    Registered User
    Join Date
    08-06-2013
    Location
    Texas, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel 2007 Transpose (Complicated)

    THANK YOU THANK YOU THANK YOU!! That worked amazingly! It took a bit to run (large files!) but it worked!

  10. #10
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Excel 2007 Transpose (Complicated)

    You can also try using Data Explorer which is a free add-in that has UN-PIVOT functionality (transpose)

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel 2007 Transpose (Complicated)

    Martha,

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ 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. Complicated Transpose Macro
    By ebdmbfan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2013, 03:38 PM
  2. Complicated VBA change to text Selection.AutoFill Excel 2007
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2012, 12:19 PM
  3. [SOLVED] very complicated transpose
    By gherzberg in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-15-2012, 01:01 PM
  4. Excel 2007 Complicated Auto-sort/Formatting Problem
    By Rossington in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2011, 12:43 PM
  5. A rather complicated sorting question for excel 2007
    By andyclay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2009, 03:30 AM

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