ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Seperate date from text (https://www.excelbanter.com/excel-programming/413900-seperate-date-text.html)

DNR

Seperate date from text
 
Hello!

I really appreciate any help on this. I am sent files weekly that contain a
column with the a date and text and I need to seperate them into two columns.
Examples of values in the columns a
05/04/2008 day
05/05/2008 night
05/07/2008 day
05/08/2008 day

etc.

The text values are always only day or night but the dates are constantly
changing. I already have a macro that will put day or night in a column next
to it based on the cell value but the original column remains the same. Any
suggestions on how to write a macro to do this?

Thanks

Don Guillett

Seperate date from text
 
Have you tried
Datatext to columnsfixed width (if all dates are the same length)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"dnr" wrote in message
...
Hello!

I really appreciate any help on this. I am sent files weekly that contain
a
column with the a date and text and I need to seperate them into two
columns.
Examples of values in the columns a
05/04/2008 day
05/05/2008 night
05/07/2008 day
05/08/2008 day

etc.

The text values are always only day or night but the dates are constantly
changing. I already have a macro that will put day or night in a column
next
to it based on the cell value but the original column remains the same.
Any
suggestions on how to write a macro to do this?

Thanks



TomPl

Seperate date from text
 
If you want to do it in code you could use language like this:

Sub testit()

ActiveCell = CDate(Left(ActiveCell, 10))

End Sub


"dnr" wrote:

Hello!

I really appreciate any help on this. I am sent files weekly that contain a
column with the a date and text and I need to seperate them into two columns.
Examples of values in the columns a
05/04/2008 day
05/05/2008 night
05/07/2008 day
05/08/2008 day

etc.

The text values are always only day or night but the dates are constantly
changing. I already have a macro that will put day or night in a column next
to it based on the cell value but the original column remains the same. Any
suggestions on how to write a macro to do this?

Thanks



All times are GMT +1. The time now is 10:31 AM.

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