i need to transfer all the even data points from column A to colu.

M

mk

i hava set of data poins that lie one above the other and i need to separate
them in 2 columns i.e all even cells from column A to column B and also at
the same time delete the even cells from column A , so that column A and B
lay side by side
 
G

Gord Dibben

mk

VBA macro.

Sub ColtoRows()
Dim rng As Range
Dim I As Long
Dim j As Long
Set rng = Cells(Rows.Count, 1).End(xlUp)
j = 1
On Error Resume Next
nocols = InputBox("Enter Number of Columns Desired")
If nocols = "" Or Not IsNumeric(nocols) Then Exit Sub
For I = 1 To rng.Row Step nocols
Cells(j, "A").Resize(1, nocols).Value = _
Application.Transpose(Cells(I, "A").Resize(nocols, 1))
j = j + 1
Next
Range(Cells(j, "A"), Cells(rng.Row, "A")).ClearContents
End Sub

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top