+ Reply to Thread
Results 1 to 13 of 13

transpose column based on unique values

  1. #1
    Forum Contributor
    Join Date
    09-14-2012
    Location
    mumbai,india
    MS-Off Ver
    Excel 2003
    Posts
    367

    transpose column based on unique values

    Hi every one,
    I need to transpose column into horizontal rows based on unique values as showing in excel. Do you have any code to solve this problem?
    Attached Files Attached Files

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: transpose column based on unique values

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: transpose column based on unique values

    This seems to work pretty well. Remeber to change the sheet variables to your liking!
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-14-2012
    Location
    mumbai,india
    MS-Off Ver
    Excel 2003
    Posts
    367

    Re: transpose column based on unique values

    karedog,
    Thanks for the code, but there is a small problem. From "A" to "E" there is a fixed column as shown in the sheet "Require'", I have attached another file as you can see..
    Attached Files Attached Files
    Last edited by sanju2323; 02-02-2019 at 02:03 AM.

  5. #5
    Forum Contributor
    Join Date
    09-14-2012
    Location
    mumbai,india
    MS-Off Ver
    Excel 2003
    Posts
    367

    Re: transpose column based on unique values

    banaanas,
    Your code is also better for use reverse data. Thank you.

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: transpose column based on unique values

    If you need the number of columns is fixed to 5 (not dynamic based on actual number of columns existed), then delete the red line and add the blue line code below :
    Please Login or Register  to view this content.

    Complete code :
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    09-14-2012
    Location
    mumbai,india
    MS-Off Ver
    Excel 2003
    Posts
    367

    Re: transpose column based on unique values

    karedog,
    It's working very well as I expected.
    Thank you so much

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: transpose column based on unique values

    @ karedog,

    Dear Sir,

    Please stop testing my temper! DON'T use Sheet Names. If the Sheet Name changes, your Code means nothing!
    Please change your Code to refer to the Sheet Index Number instead.

    I REALLY like your Code, well done my Friend!

    Kudos to you.

    Kind Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: transpose column based on unique values

    @sanju,
    You are welcome, thank for marking the thread as solved.

    @Winon,
    My Lord Winon the Dukes of Bad Temper Castle,
    It is my honour to have Thy presence on my posts.
    Although the truth is all Thine,
    but the peasants like it when the Sheet's names is used instead of Sheet's Index,
    since it is easier to adapt to their actual file(s).
    Upset not with this my Lord, the glory be all Thou art worth.


    Regards

  10. #10
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,285

    Re: transpose column based on unique values

    karedog from this case how to make parent and child collection
    strkey1 = columns(a) is key 1
    strkey2 = columns(b) is key 2
    i want have 2 collection
    see this picture
    karedog1.png
    Please Login or Register  to view this content.
    "ThankyouFor Attention * And Your Help!!"

  11. #11
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: transpose column based on unique values

    Should be :
    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,285

    Re: transpose column based on unique values

    thank your very match karedog
    i want ask more again
    how to remove not double child 2 key
    in my picture row(7) count = 1 ignore it
    i want to know COUNT For collections(1) and collection(2) and collection(3)
    and how to remove from collection if ignore value like in row(7)
    karedog col.png

    Please Login or Register  to view this content.
    Last edited by daboho; 02-02-2019 at 03:11 PM.

  13. #13
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: transpose column based on unique values

    Please Login or Register  to view this content.
    If you have more questions, please start a new thread, you are hijacking someone else's thread.
    (Forum member sanju2323 (OP) and banaanas will keep get new notifications, while they are already not interested in this topic)

+ 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. Replies: 7
    Last Post: 10-23-2018, 10:18 AM
  2. Transpose column to rows based on values in two other columns
    By jacobburdis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-11-2017, 01:48 PM
  3. Transpose column unique values in multiple rows
    By is2_egypt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2016, 08:25 AM
  4. Replies: 2
    Last Post: 08-19-2015, 10:22 AM
  5. Transpose unique numbers based on another column
    By Jon.R in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2014, 03:31 PM
  6. How to transpose a column based on similar values
    By tdunford7 in forum Excel General
    Replies: 4
    Last Post: 02-28-2012, 12:51 AM
  7. Transpose unique values in one column/mult. rows into a single row
    By Wil in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2005, 04:06 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