Solved

reorder data

Posted on 2014-02-18
5
184 Views
Last Modified: 2014-02-19
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
Comment
Question by:pma111
5 Comments
 
LVL 29

Accepted Solution

by:
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

Open in new window


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

Assisted Solution

by:Rob Henson
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 49

Assisted Solution

by:Rgonzo1971
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)))

Open in new window


Regards
EE20140218.xlsx
0
 
LVL 3

Author Comment

by:pma111
ID: 39867944
many thanks
0
 
LVL 29

Expert Comment

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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question