vba - Merge Excel rows where record was split -


i'm exporting report , record splits multiple rows when importing excel. each report has upwards of 30k rows after import. column spared split column a, each other column split 2-4 rows. there anyway automatically merge these rows looks bottom portion of image attached?

concatenation export , ideal results: excel

you may want use code:

option explicit  sub main()     dim area range     dim strng string     dim irow long, startrow long, endrow long, icol long      worksheets("export") '<--| change "export" actual sheet name         .range("a2:a" & .usedrange.rows(.usedrange.rows.count).row).specialcells(xlcelltypeblanks)             each area in .areas                 strng = ""                 startrow = area.end(xlup).row                 endrow = area.rows(area.rows.count).row                 icol = area.end(xltoright).column                 irow = startrow endrow                     strng = strng & .parent.cells(irow, icol) & " "                 next irow                 .parent.cells(startrow, icol) = strng             next area             .entirerow.delete         end     end end sub 

Comments