ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   date number separation (https://www.excelbanter.com/excel-discussion-misc-queries/88588-date-number-separation.html)

steven

date number separation
 
Hi this might be easy for you guys...

In column A I got a date in the 1st row, number in the 2nd, date in the 3rd,
number in the 4th and so on up to row 200. I want dates only in column A and
numbers only in column B (the number that is directly below each date). Also
no blank cells in between the rows.

Of course i could copy paste everything and then manually delete every
second row but that would take forwever. any suggestions?

thanks

S.

Bob Phillips

date number separation
 
Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim nCalculation

With Application
.ScreenUpdating = False
nCalculation = .Calculation
.Calculation = xlCalculationManual
End With

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
If Int(iLastRow / 2) * 2 < iLastRow Then iLastRow = iLastRow - 1
For i = iLastRow To 2 Step -2
Cells(i, "A").Copy Cells(i - 1, "B")
Rows(i).Delete
Next i

With Application
.Calculation = nCalculation
.ScreenUpdating = True
End With

End Sub



--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"steven" wrote in message
...
Hi this might be easy for you guys...

In column A I got a date in the 1st row, number in the 2nd, date in the

3rd,
number in the 4th and so on up to row 200. I want dates only in column A

and
numbers only in column B (the number that is directly below each date).

Also
no blank cells in between the rows.

Of course i could copy paste everything and then manually delete every
second row but that would take forwever. any suggestions?

thanks

S.




Fred Smith

date number separation
 
If you don't want to use a macro, you can do it as follows:

1. Turn on DataFilter
2. Select the dates
3. Copy the visible cells to column B
4. Select the numbers
5. Copy the visible cells to column C
6. Delete column A

--
Regards,
Fred


"steven" wrote in message
...
Hi this might be easy for you guys...

In column A I got a date in the 1st row, number in the 2nd, date in the 3rd,
number in the 4th and so on up to row 200. I want dates only in column A and
numbers only in column B (the number that is directly below each date). Also
no blank cells in between the rows.

Of course i could copy paste everything and then manually delete every
second row but that would take forwever. any suggestions?

thanks

S.





All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com