Merge Rows Using Column One Values

Anonymous
2022-08-25T08:09:55+00:00

I would like to merge rows based on Column 1 values of my data set.

ℹ Sample data is pasted below.

E.g. I select the range from A1:D20 and run the macro.

See After Merge screenshot:

Need to autofit row height,

no border required for the selected range. I added for the merged rows to stand out.

Before Merge:

After Merge:

Sample data to copy into your workbook.

453564 4926 453564 AMZ CM PCD Name One TNB 5455-66
453564 4926 453564 AMZ CM PCD Name One HGT 3343-5
453564 4926 453564 AMZ CM PCD Name One VVF 434-67
453564 210254 453564 AMZ CM PCD Name Two TNB 5455-66
453564 210254 453564 AMZ CM PCD Name Two HGT 3343-5
453564 210254 453564 AMZ CM PCD Name Two VVF 434-67
45356450 20243 45356450 Reusable Temp Name Three GST 223-5
45356450 20243 45356450 Reusable Temp Name Three VDDDR 888-55
564703941 1024926 564703941 CHL-VS for VSa Name One TNB 5455-66
564703941 1024926 564703941 CHL-VS for VSa Name One HGT 3343-5
564703941 1024926 564703941 CHL-VS for VSa Name One VVF 434-67
564703941 1025470 564703941 CHL-VS for VSa Name Two TNB 5455-66
564703941 1025470 564703941 CHL-VS for VSa Name Two HGT 3343-5
564703941 1025470 564703941 CHL-VS for VSa Name Two VVF 434-67
3564801131 1024926 3564801131 CHL-VI 20 IO Name One TNB 5455-66
3564801131 1024926 3564801131 CHL-VI 20 IO Name One HGT 3343-5
3564801131 1024926 3564801131 CHL-VI 20 IO Name One VVF 434-67
3564801131 1025470 3564801131 CHL-VI 20 IO Name Two TNB 5455-66
3564801131 1025470 3564801131 CHL-VI 20 IO Name Two HGT 3343-5
3564801131 1025470 3564801131 CHL-VI 20 IO Name Two VVF 434-67
Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

14 answers

Sort by: Most helpful
  1. Anonymous
    2022-08-28T16:47:08+00:00

    Thank you for the online SQL solution!

    It would have been good if the whole page is in English including table names and column names. I am having hard time reading Chinese table and column names.

    0 comments No comments
  2. Anonymous
    2022-08-28T22:03:07+00:00

    If you upload raw data with English column name,it is possible to modify the sql from Chinese column names as blow and then get a table with English column name.

    Google chrome browser also provide translate service.

    I generate these Chinese column names with the php script which default language is Chinese.

    select count(*) 行,F_A,F_B,F_C,F_D,group_concat(F_E),group_concat(F_F) from MergeRowsUsingColumnOne group by F_A order by rowid;

    http://e.anyoupin.cn/bsbm/pdo/eh2/a2502/mybookmark/sql/sql/display_table.php?find=select+count%28%2A%29+%E8%A1%8C%2CF_A%2CF_B%2CF_C%2CF_D%2Cgroup_concat%28F_E%29%2Cgroup_concat%28F_F%29+from+MergeRowsUsingColumnOne+group+by+F_A+order+by+rowid%3B

    0 comments No comments
  3. Anonymous
    2022-08-29T05:08:35+00:00

    I tried modifying the heading then I get error.

    Also when I use the Web link to import the table I don't see the table in the preview.

    在线sql (anyoupin.cn)

    Even if I try to import will excel retain merged columns as shown on website?

    0 comments No comments
  4. Anonymous
    2022-08-29T12:10:23+00:00

    tried modifying the heading then I get error.

    also need to modify url with new sql

    refer to below video

    【modify url when heading changed-】 https://b23.tv/L73wUhI

    Also when I use the Web link to import the table I don't see the table in the preview.

    I have found the interface of your web query is different from below .

    please refer to this

    web query

    0 comments No comments