Solved

# reorder data

Posted on 2014-02-18
181 Views
is there an easy way in excel, to re-order data. essentially into a single column (A) I need to "merge" two columns (B and C).

I need to copy data from columns B and column C into column A, however they need to be copied in a sequential order, so

A1 needs to be a copy of B1
A2 needs to be a copy of C1
A3 needs to be a copy of B2
A4 needs to be a copy of C2
A5 needs to be a copy of B3
A6 needs to be a copy of C3

etc. is this possible?
0
Question by:pma111

LVL 29

Accepted Solution

gowflow earned 167 total points
ID: 39867838
Yes thru VBA this code should do it

``````Sub TransferBCToA()
Dim WS As Worksheet
Dim MaxRow As Long, I As Long
Dim cCell As Range

Set WS = ActiveSheet
MaxRow = WS.UsedRange.Rows.Count
I = 1

For Each cCell In WS.Range("B1:C" & MaxRow)
WS.Cells(I, "A") = cCell
I = I + 1
Next cCell
End Sub
``````

check the attached file and activate macros and hit the button.
gowflow
TransferBCtoA.xls
0

LVL 31

Assisted Solution

Rob Henson earned 167 total points
ID: 39867872
Without VBA:

Insert a column between the two columns.
In the new column and alongside the other column, against each row put a column of incrementing numbers, ie row 1 to 100.

Then copy the second column of data with its row reference below the first set.

You will then have rows 1 to 100 twice. You can the sort on the number column and both number 1's will sort together, number 2's together etc.

Thanks
Rob H
0

LVL 48

Assisted Solution

Rgonzo1971 earned 166 total points
ID: 39867919
Hi,

or with a formula

``````=INDIRECT(ADDRESS((ROW(A1)+1)/2-1+1,2+MOD(ROW(A1)-1,2)))
``````

Regards
EE20140218.xlsx
0

LVL 3

Author Comment

ID: 39867944
many thanks
0

LVL 29

Expert Comment

ID: 39869730
Did you had a chance to check the proposed solutions ?
gowflow
0

## Featured Post

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…