excel - macro to re-arrange data -


i have been trying write macro re-arrange cells in rows , columns of stock tables output desire. luckily stock tables same each , every time (different names , values), , desired outcome same format..

here example data.

                              

1 name
2 description
3 description
4 description
5 description
6 id#: 56284
7 quantity in stock: 34
8 zoom in , configure

      b 

1 name
2 description
3 description
4 description
5 description
6 id#: 56284
7 quantity in stock: 50
8 zoom in , configure

and output go this(if possible sheet2 starting on cell b2):

b    c    e 

b being row 1 c being row 2 3 4 , 5 combined e being row 7 stock value i.e 50

on single spreadsheet there 4 columns, , 8 rows have re-arrange.. making 32 total.

it great automated this, appreciated.

let me clarify understanding. each column want following data format:

                                                 1   name                                       1   name 2   desc1                                      2   desc1; desc2; desc3; desc4 3   desc2                      on sheet 2      3   50 4   desc3                   ---------------> 5   desc4 6   id#: 56284 7   quantity in stock: 50 8   zoom in , configure 

if case can use following code. assumes data in a1 d8 in sheet 1.

sub formatdata()     dim col integer      col = 1 4         worksheets(2)            .cells(1, col) = cells(1, col) //get name            .cells(2, col) = cells(2, col) & "; " & cells(3, col) & "; " & cells(4, col) & "; " & cells(5, col) //concatenate descriptions single string            .cells(3, col) = cells(7, col) //get quantity in stock         end     next col end sub 

Comments