Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm not very good at programming. I have one column with values as such: (x1,y1,x2,y2,x3,y3.......) They alternate from x to y. How can I take this column and make two columns, one for x and another for y? It is alot of data, so manual copy and paste is out of the question. Please help! -- cshivley ------------------------------------------------------------------------ cshivley's Profile: http://www.excelforum.com/member.php...o&userid=34773 View this thread: http://www.excelforum.com/showthread...hreadid=545344 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() The columns looks like this: x1 y1 x2 y2 x3 y3 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi C,
Try: '============= Public Sub Tester01() Dim WB As Workbook Dim SH As Worksheet Dim rng As Range Dim destRng As Range Dim rCell As Range Dim LastRow As Long Dim iCol As Long Const Col As Long = 1 '(column "A") '<<==== CHANGE Set WB = Workbooks("YourBook.xls") '<<===== CHANGE Set SH = WB.Sheets("Sheet3") '<<===== CHANGE With SH LastRow = .Cells(Rows.Count, Col).End(xlUp).Row Set rng = Range(Cells(2, Col), Cells(LastRow, Col)) rng.Offset(0, 1).Resize(, 2).ClearContents For Each rCell In rng.Cells iCol = IIf(iCol = Col + 1, Col + 2, Col + 1) Set destRng = .Cells(Rows.Count, iCol).End(xlUp)(2) rCell.Copy destRng Next rCell End With End Sub '<<============= --- Regards, Norman "cshivley" wrote in message ... The columns looks like this: x1 y1 x2 y2 x3 y3 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
seperating columns | Excel Discussion (Misc queries) | |||
Seperating Text from Columns | Excel Discussion (Misc queries) | |||
Seperating Text from Columns | Excel Discussion (Misc queries) | |||
Seperating Text from Columns | Excel Discussion (Misc queries) | |||
Seperating cells and columns | Excel Discussion (Misc queries) |