Solved

reorder data

Posted on 2014-02-18
5
181 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 31

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 48

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now