Hi could anyone help me how to convert a row into a table

I need to convert a row 1 2 3 4 5 6 into a table1 2 3

4 5 6Thank you

I'm sure that you are going to need to give us more information about what you are trying to do. Based on the example that you have provided, some very simple formulas will give you what you asked for:

A B C D E F 1 1 2 3 4 5 6 2 =A1 =B1 =C1 3 =D1 =E1 =D1

Thank you for your reply. I have a time series of 50 observations but in order to process the data in fortran i need to organise it into a table of 4 columns.

Therefore, I guess that simple formula will not work. I have big array.

This code will take a row of data that starts in A1 and convert it into a 4 column table starting in A2. Sub FourCols() 'Find last column with data in Row 1 lastCol = Cells(1, Columns.Count).End(xlToLeft).Column 'Calculate how many sets of 4 we need setCount = Application.WorksheetFunction.RoundUp(lastCol / 4, 0) + 1 'Loop through Destination Rows For nxtDstRow = 2 To setCount 'Loop through Destination Columns For nxtDstCol = 1 To 4 'Increment Source Column nxtSrcCol = nxtSrcCol + 1 'Put values in cells Cells(nxtDstRow, nxtDstCol) = Cells(1, nxtSrcCol) Next Next End Sub

Ask Your Question

Weekly Poll

Do you think its a good idea for Amazon to divide its new second headquarters between two locations?

Discuss in The Lounge

Poll History