+ Reply to Thread
Results 1 to 25 of 25

Merging data from mulitiple rows with the same timestamp into a single row.

  1. #1
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Merging data from mulitiple rows with the same timestamp into a single row.

    5pm a----b----c---- d---- e-----f---- g,h-------I,j----- k,m-----
    5pm a----b---- c---- empty-empty-empty-empty-empty-empty
    5pm empty-empty-empty----d----e---- f---- -empty-empty-empty
    5pm empty-empty-empty-empty-empty-empty-----g --- i----k----
    5pm empty-empty-empty-h-----j----m----empty-empty-empty
    5:01pm
    5:01pm



    I will have to merge the data in all the different fields with

    the same time-stamp from 4 different row to a single row, as

    shown above( merge into the row that is in BOLD. ) is there any

    solutions for that?

  2. #2
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi Gracejo,

    Welcome to the forum. Is it possible if you attached a workbook, it would be easier to understand!

    Cheers
    Lex

  3. #3
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    I have attached the example in the reply.
    Thanks.
    Attached Files Attached Files

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi Gracejo,

    try this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi nilem,

    I've tried the code but however, I received a compile error:Expected End Sub as shown in the image that i have attached.
    I have tried adding another "End Sub" at the bottom of the whole code but i still receive the same compile error.
    Attached Images Attached Images

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi Gracejo,
    here is your file
    please try again
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hey,
    So sorry. i cant seem to open the file. not sure is it because of the format. my excel files are with extension "xlsx".

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    xlsm is an extension of Excel macro enabled files

  9. #9
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi I managed to open up the file already. Thanks alot.

    However, i don't quite understand the different lines in the codes.
    As i'm suppose the implement the same function into another excel file with more columns.

    could i ask for some explanations to the line of codes. or which lines do i have to focus on to edit in order to implement it to anotherexcel file with more columns and data.

  10. #10
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    i do have another question. if i have duplicate data with the same timestamp, what code should i add in to filter them out then merge the other columns into a single row as previously.

  11. #11
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Macro does just that.
    Just try it. Or attach an example file if it does not work.

  12. #12
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    I have tried your code to the excel book that i have but it doesn't work.

    Attached is just one part of the whole data.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Also, I have tried the code on this sample program but it doesn't remove the duplicates.

    I have added duplicate values to Column F. However, after clicking the button, it still shows all the duplication.
    Attached Files Attached Files

  14. #14
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    here you go
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi,
    Example-2.1 works perfectly and awesomely. Thanks
    However, i have no idea why it does not work on my excel sheet. is it got to do with the different columns?

    Attached is the another example of the my excel sheet. would appreciate some help.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    oops. sorry. uploaded the wrong file. i will upload the file again in 5 mins.

  17. #17
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi,
    Example-2.1 works perfectly and awesomely. Thanks
    However, i have no idea why it does not work on my excel sheet. is it got to do with the different columns?

    Attached is the another example of the my excel sheet. would appreciate some help.

    PS: this is the right file.
    Attached Files Attached Files

  18. #18
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Your 'Time' column is the second column (in 'test2.xlsm')
    So change this line in the code
    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi,

    it's working for the merging already.
    However, do you have any idea why the timestamp after going through the program will change into some random number in sheet 2 instead of remaining the same.

  20. #20
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    QUESTION.JPG


    Let me rephrase my question.
    Above is the image of the data changed.
    Anyone has any idea why does the time changes to weird numbers after running through the script?

    I have also attached the excel file below.
    Last edited by gracejo; 06-19-2014 at 08:42 PM. Reason: no attachment added

  21. #21
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    attached is the attachment of my file.
    Attached Files Attached Files

  22. #22
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    Hi gracejo,
    just set the cell format as you need
    Please Login or Register  to view this content.

  23. #23
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    wow. Thanks.
    However, why do they become to be "######" in sheet 2?

    i will have to click on "######" in order to see the date and time.

  24. #24
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    wow. Thanks.
    However, why do they become to be "######" in sheet 2?

    i will have to click on "######" in order to see the date and time.

  25. #25
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    I was hoping that you will choose the column width manually.
    Okay, let's add one more line in the code
    Please Login or Register  to view this content.

  26. #26
    Registered User
    Join Date
    06-17-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    19

    Re: Merging data from mulitiple rows with the same timestamp into a single row.

    AWESOME AWESOME!!!
    Thanks alot for your help!!!

+ 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. Merging Text Rows into single Row - separated by row of quaracters or blank
    By designooze in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2013, 04:22 PM
  2. merging different data from rows into a single row
    By ronanpower in forum Excel General
    Replies: 4
    Last Post: 02-26-2013, 02:13 AM
  3. Merging Rows in a Single column
    By bajjan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2012, 10:43 AM
  4. Merging multiple rows and column data for each unique ID into single row
    By skilaru in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2012, 11:59 AM
  5. Merging multiple rows into a single row
    By barry_jordan in forum Excel General
    Replies: 5
    Last Post: 01-13-2012, 11:50 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