+ Reply to Thread
Results 1 to 13 of 13

Manage and format raw data with VBA

  1. #1
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Question Manage and format raw data with VBA

    Hi Gurus,

    I've the following raw data exported from other system.

    Wish to get the expected output data in this format, maybe with vba coding.

    Sample Data:
    STUD011264 789 TEACHER1 Math and science
    STUD010874 789 TEACHER2 Drama and social studies
    STUD010876 789 TEACHER1 Biology
    STUD011006 789 TRAINER1 Basketball and tennis
    STUD011008 789 TEACHER4 Geography and history

    Sample Output:
    STUD011264, STUD010874, STUD010876, STUD011006, STUD011008
    -> Output in first row

    Math and science, Drama and social studies, Biology, Basketball and tennis, Geography and history
    -> Output in second row

    Apperciate for your help.

    Thank you.


    - Jack
    Regards,
    Jack

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Manage and format raw data with VBA

    Try this..

    Select you data > Copy it using Ctrl+C

    On a couple of rows below paste using Ctrl+Alt+V > E

    Then re-arrange rows as required..

    Let me know if that solves..
    Cheers!
    Deep Dave

  3. #3
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Manage and format raw data with VBA

    Hi Gurus,

    I've attached a sample data in this post.

    Sample of output data are highlighted in light blue.

    Thanks for your help.


    - Jack
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Manage and format raw data with VBA

    Hi Gurus,

    Thanks for your reply.

    The sample data that I've posted is only a small portion.

    I usually have a very long listing, maybe about 20 to 30 items at 1 time.

    So, would prefer if it can be done using some kind of VBA coding.

    Thank you.


    - Jack

  5. #5
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Manage and format raw data with VBA

    Hi Gurus,

    Anybody can help me please?

    Thanks.


    - Jack

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Manage and format raw data with VBA

    UDF

    Use in cell like
    =JoinLR(A1:A5,1)
    =JoinLR(A1:A5,0)
    1(true) for the left, 0(false) for the right.


    To a standard module
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Manage and format raw data with VBA

    Hi jindon,

    Thanks for your reply and help.

    It works almost perfect .... need to check if it can be enhanced to cater for more entries eventhough the actual entries are not that many, see below.

    =JoinLR(A1:A100,1)
    =JoinLR(A1:A100,0)


    Thanks.


    - Jack

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Manage and format raw data with VBA

    Don't understand what you are talking about.

    I wrote the code according to your workbook and it is doing exactly what you have in your attachment.

  9. #9
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Manage and format raw data with VBA

    Hi jindon,

    Ok, maybe I can try to put it in this way, will it be possible to make the code to be more dynamic? Meaning, it'll be able to automatically cater for x number of entries that is provided? It could be shorter, but it could also be longer.

    As per my sample data, I've only given a sample data of 5 entries.

    Thank you.


    - Jack

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Manage and format raw data with VBA

    Then sub routine
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Manage and format raw data with VBA

    Hi jindon,

    Great, it works perfectly.

    Appreciate for your help.

    Thanks.
    Last edited by SmallJack; 04-13-2015 at 10:41 AM. Reason: update footer

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Manage and format raw data with VBA

    You are welcome and thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  13. #13
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Manage and format raw data with VBA

    Hi jindon,

    Done. Thank you.

    Have a nice day


    - Jack

+ 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. I need to find data from column and insert to two differnet sheet
    By 1Melina in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2014, 05:04 PM
  2. Using INDEX, OFFSET, etc. to manage data
    By tshine1030 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 09:36 PM
  3. manage data using macro
    By rohini1 in forum Excel General
    Replies: 2
    Last Post: 05-17-2012, 05:02 AM
  4. Help require to manage data.
    By noodle in forum Excel General
    Replies: 6
    Last Post: 09-30-2009, 04:49 AM
  5. Replies: 2
    Last Post: 07-13-2005, 12:05 PM

Tags for this Thread

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