+ Reply to Thread
Results 1 to 8 of 8

Transfer data with Horizontal headings to sheet with vertical headings

  1. #1
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Transfer data with Horizontal headings to sheet with vertical headings

    Hello Gurus

    I have data with headings which are 1, 2, 3, thus headings are numbers. The data under headings is in strings.

    In sheet1 I have database as follows

    Row1=====1======2=====3
    Row2====data====data===data
    Row3====data====data===data
    Row4====data====data===data
    and so on

    I have records in sheet2 that I want to transfer to sheet1. In sheet2, the headings are in ColumnA and data is all in columnB as shown below.
    Column1 ==== Column2
    ==0========data===
    ==0========data===
    ==1========data===
    ==0========data===
    ==2========data===
    ==3========data===
    ==0========data===
    ==0========data===
    ==1========data===
    ==0========data===
    ==2========data===
    ==3========data===
    ==1========data===
    ==2========data===
    ==0========data===
    ==3========data===
    and so on

    Note that there are some 0 headings that are not needed to be imported.

    Is it possible for a macro to check columnA and (skipping any 0s) transfer all other data to related fields in Sheet1 at the bottom?
    Last edited by caabdul; 01-08-2018 at 05:44 PM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Transfer data with Horizontal headings to sheet with vertical headings

    Make Sheet1 the active sheet and try this macro:
    Please Login or Register  to view this content.
    Last edited by Mumps1; 01-08-2018 at 05:26 PM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Transfer data with Horizontal headings to sheet with vertical headings

    Thanks for the solution but I had already come to an alternative as follows:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Transfer data with Horizontal headings to sheet with vertical headings

    I'm glad it worked out. Just a comment for your consideration ..... The macro I suggested uses filtering so it is fairly fast. If you have a very large data set, your looping macro may be slower. This may not be a factor for you but I thought I would mention it.

  5. #5
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Transfer data with Horizontal headings to sheet with vertical headings

    It makes sense but I am new to macros and couldn't understand your code much. Can you please suggest some source where I can learn filtering?

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Transfer data with Horizontal headings to sheet with vertical headings

    Perhaps the easiest and quickest way is to do a search online. Just type in something like "filter data excel vba" (without the quotes) as your search criteria. There is plenty of help online. For more information in general about VBA, a good place to start is the very first thread in this Forum (highlighted in blue).

  7. #7
    Forum Contributor
    Join Date
    12-25-2011
    Location
    Lahore, Punjab, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    287

    Re: Transfer data with Horizontal headings to sheet with vertical headings

    Filtering in vba is wonderful thing, I am looking at it for future. Thanks

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Transfer data with Horizontal headings to sheet with vertical headings

    My pleasure.

+ 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. showing only headings not the data below the headings
    By geniusufo007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2017, 06:11 AM
  2. [SOLVED] Macro to convert a Flat Data with many Headings to a Database with few Headings
    By rehana402003 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2017, 06:51 AM
  3. How to make a Templates column headings dynamic with the Pivot table headings
    By DashBD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2017, 05:20 PM
  4. Replies: 6
    Last Post: 06-24-2015, 12:03 AM
  5. Transfer data from vertical to horizontal
    By vutienhp in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-20-2015, 09:12 AM
  6. Trying to summarise data with horizontal headings - Excel 2010
    By tuph in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-15-2014, 07:27 PM
  7. vertical, offset column headings
    By oddcarout in forum Excel General
    Replies: 1
    Last Post: 11-12-2010, 03:15 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