Solved

reorder data

Posted on 2014-02-18
5
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 30

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 33

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 51

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 30

Expert Comment

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

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

691 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