+ Reply to Thread
Results 1 to 8 of 8

Transpose columns to rows where data exists

  1. #1
    Registered User
    Join Date
    03-03-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Transpose columns to rows where data exists

    This is hard to explain so I've attached an example of what I need.

    Basically there are authors for each book and they are listed in separate columns but I need them in a single column.

    For my data there are thousands of rows and heaps of columns (some books have 50+ authors so that is 50+ columns).

    I'm pretty clueless with the macro language so help would be great. Thanks.
    Attached Files Attached Files
    Last edited by Ochenden; 03-04-2011 at 12:50 AM.

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

    Re: Transpose columns to rows where data exists

    Ochenden,

    Welcome to the Excel Forum.

    Detach/open workbook ReorgData w1 columns wR A B - Ochenden - EF766909 - SDG12.xls and run macro ReorgData.


    To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
    Last edited by stanleydgromjr; 03-04-2011 at 12:27 AM.
    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
    Registered User
    Join Date
    03-03-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Transpose columns to rows where data exists

    Wow. Works a treat! This weekend I'm going to start learning this stuff - it's so powerful.

    Thank you this saves a lot of time.

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

    Re: Transpose columns to rows where data exists

    Ochenden,

    Training / Books / Sites:

    How to Learn to Write Macros
    http://articles.excelyogi.com/playin...ba/2008/10/27/

    How to use the macro recorder
    http://articles.excelyogi.com/

    Click here and scroll down to Getting Started with VBA.
    http://www.datapigtechnologies.com/ExcelMain.htm

    If you are serious about learning VBA try
    http://www.add-ins.com/vbhelp.htm

    Excel Tutorials and Tips - VBA - macros - training
    http://www.mrexcel.com/articles.shtml

    See David McRitchie's site if you just started with VBA
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Debra Dalgleish has some notes how to implement macros here:
    Excel VBA -- Adding Code to a Workbook
    http://www.contextures.com/xlvba01.html

    David McRitchie has an intro to macros:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Ron de Bruin's intro to macros:
    http://www.rondebruin.nl/code.htm

    Creating custom functions
    http://office.microsoft.com/en-us/ex...117011033.aspx

    Writing Your First VBA Function in Excel
    http://www.exceltip.com/st/Writing_Y...Excel/631.html

    http://www.excel-vba.com/
    http://www.mvps.org/dmcritchie/excel/getstarted.htm
    http://www.exceltip.com/excel_links.html

    (livelessons video)
    Excel VBA and Macros with MrExcel
    ISBN: 0-7897-3938-0
    http://www.amazon.com/Excel-Macros-M...7936479&sr=1-1

    http://www.youtube.com/user/ExcelIsFun#g/search

    http://www.xl-central.com/index.html

    http://www.datapigtechnologies.com/ExcelMain.htm

    Dependent validation lists. Debra has a neat little tutorial here.
    http://www.contextures.com/xlDataVal02.html

    Data Validation > Drop-Down Lists - Dependent
    http://www.bettersolutions.com/excel...E229212022.htm

    Cascading queries
    http://www.tushar-mehta.com/excel/ne...ing_dropdowns/

    http://www.contextures.com/xlDataVal05.html

    Excel Data Validation - Add New Items
    http://www.contextures.com/excel-dat...ation-add.html

    Programming The VBA Editor - Created by Chip Pearson at Pearson Software Consulting LLC
    This page describes how to write code that modifies or reads other VBA code.
    http://www.cpearson.com/Excel/vbe.aspx

    Locating files containing VBA
    Searching Files in Subfolders for VBA code string:
    http://www.dailydoseofexcel.com/arch...a-code-string/

    http://www.pcreview.co.uk/forums/thread-978054.php

    Excel 2003 Power Programming with VBA, by John Walkenbach

    VBA and Macros for Microsoft Excel, by Bill Jelen "Mr.Excel" and Tracy Syrstad

    Excel Hacks 100 Industrial-Strength Tips & Tools, by David & Traina Hawley

    VBA and Macros for Microsoft Excel 2007, by Bill Jelen "Mr.Excel" and Tracy Syrstad

    Excel 2007 Book: you can try this...there is a try before you buy ebook available at this link…
    http://www.mrexcel.com/learnexcel2.shtml

    DonkeyOte: My Recommended Reading:
    Volatility
    http://www.decisionmodels.com/calcsecretsi.htm

    Sumproduct
    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    Introduction to Array Formulas
    http://www.xtremevbtalk.com/showthread.php?t=296012

    Using Pivot Tables and Pivot Charts in Microsoft Excel
    http://peltiertech.com/Excel/Pivots/pivotstart.htm

    A List of Pivot Table links at Jon Peltier's site (contributed by Debra Dalgleish) is here:
    http://peltiertech.com/Excel/Pivots/pivotlinks.htm

    Email from XL - VBA & Outlook VBA
    http://www.rondebruin.nl/sendmail.htm
    http://www.outlookcode.com/article.aspx?ID=40

    Excel Function Dictionary
    http://www.xlfdic.com/

    Excel 2007 function name translations
    http://www.piuha.fi/excel-function-name-translation/

    Dynamic Named Ranges
    http://www.contextures.com/xlNames01.html

    Where to paste code in VBE VBA
    Introducing the Excel VBA Editor
    http://www.ask.com/web?qsrc=2417&o=1...cel+VBA+Editor

    VBA for Excel (Macros)
    http://www.excel-vba.com/excel-vba-contents.htm

    VBA Lesson 11: VBA Code General Tips and General Vocabulary
    http://www.excel-vba.com/vba-code-2-1-tips.htm

    Excel VBA -- Adding Code to a Workbook
    http://www.contextures.com/xlvba01.html

    Basics of array formulas
    http://www.youtube.com/view_play_lis...7E7E9CA63304D3

    Array formula data extract formulas
    http://www.youtube.com/watch?v=Tp7I5u1MqiM
    http://www.youtube.com/watch?v=R5ZWAiNJLNo
    http://www.youtube.com/watch?v=132ZdpxBm1U

    Unique Record Counting and Data Extract formulas
    http://www.youtube.com/watch?v=uUrI8hoj8BA

  5. #5
    Registered User
    Join Date
    03-29-2007
    MS-Off Ver
    365
    Posts
    70

    Re: Transpose columns to rows where data exists

    Hi All,

    I have a similar situation, but I have data in Column A, Band C to copy down.

    I guess looking at the example file is more self-explanatory.

    thanks all for your help.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Transpose columns to rows where data exists

    tt388 -please start your own thread as per forum rules.

  7. #7
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Transpose columns to rows where data exists

    stanleydgromjr,

    I was wondering how I could use your transpose columns into rows code with the excel workbook "sample.xlsm" I attached to this post reply. I tried to modify your code but I could not get the same results.

    I know you helped Ochenden with this simple example, but my data set contains column headings.

    I want to group columns E through R with a new column title by the name "test" and the data within them under a new column title by the name "testresponse".

    I provided you with a worksheet in the workbook of what the data should look like.

    Thanks in Advance
    Attached Files Attached Files

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

    Re: Transpose columns to rows where data exists

    boldcode,

    Please start your own NEW Post.

    Then send me a Private Message with a link to YOUR NEW POST, and I will look at your workbook.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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