+ Reply to Thread
Results 1 to 21 of 21

Collate Data

  1. #1
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Collate Data

    Hello Everyone,

    I have come across a situation where I have to collate data in a particular fashion. I'm attaching an excel file containing both the input and the output I'm looking at. It contains two problems, would appreciate if anyone can help me solve this riddle.
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Collate Data

    See if this helps...

    http://www.excelforum.com/excel-gene...ngle-cell.html
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    Thanks for the quick response

    Problem 1: It is providing the desired result, but can we have any formula that do the same thing?
    Problem2: This remains unanswered.

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Collate Data

    For Problem2, the same thread will solve it, but for a formula in E2 copied down...

    =A2&";"&B2&";"&C2&";"&D2

    For Problem1, if you want it to remain dynamic, then instead of the UDF try this and just attach it to a command button to run


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    How will I get the colors associated with each column i.e. Pink for Col A?

  6. #6
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    Quote Originally Posted by Chatbot View Post
    How will I get the colors associated with each column i.e. Pink for Col A?
    Please check the output column of problem2...

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Collate Data

    That will require VBA, but you can't mix with a worksheet formula.

    Do you want VBA?

  8. #8
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    It would be gr8 if you can explain the code.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Collate Data

    You could use this:

    Please Login or Register  to view this content.
    E..g., in B2,

    =CatR(A2:A65536, ";")
    Last edited by shg; 08-26-2011 at 03:54 PM. Reason: replace chopped line
    Entia non sunt multiplicanda sine necessitate

  10. #10
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    Waitin for the vba code

  11. #11
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    Its looks incomplete, plz attach the excel file

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Collate Data

    That is the complete VBA code.

    Put the code in a code module, and put the formula in the cell as in the example.

    Adding a Macro to a Code Module
    1. Copy the code from the post
    2. Press Alt+F11 to open the Visual Basic Editor (VBE)
    3. From the menu bar in the VBE window, do Insert > Module
    4. Paste the code in the window that opens
    5. Press Alt+Q to close the VBE and return to Excel

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Collate Data

    Sorry, a line was chopped off (thanks, Jeffrey), fixed in prior post.

  14. #14
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    Else
    For Each vItem In Intersect(rInp, rInp.Worksheet.UsedRange)
    sItem = CStr(vItem)
    If Len(sItem) Then CatR = CatR & sItem & sSep
    Next vItem
    End If

    If Len(Ca

    Please check the closing, something is missing I guess.

  15. #15
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    is this for problem 2? Its not working.

  16. #16
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    Prob 2: I have four columns which contains data, each column has a different color.

    please check the output

  17. #17
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Collate Data

    Problem 1.

  18. #18
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Collating Data.

    Help me collate data in the attached fashion.

  19. #19
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    If somone can solve the problem 2

  20. #20
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Collate Data

    For problem 2 you can not use a udf but instead you will need to make use of the worksheet change event.

    right click sheet tab and View Code.
    Paste the following.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  21. #21
    Registered User
    Join Date
    07-14-2011
    Location
    Jax
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Collate Data

    Please explain this code with the help of an example, I'm unable to execute it

+ 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