ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need macro to change date from yyyymmdd format to mm/dd/yyyy forma (https://www.excelbanter.com/excel-programming/345748-need-macro-change-date-yyyymmdd-format-mm-dd-yyyy-forma.html)

iris

Need macro to change date from yyyymmdd format to mm/dd/yyyy forma
 
I received some data with the dates in a yyyymmdd format. Although I can go
in and change this by splitting the data up with the text to column option,
then concatenate the rows with a "/" in between them, I was wondering if
anyone has put together a macro to do this a bit faster than it takes to go
through all of these other steps.

Thanks,
--
Acknowledge and Move on.

Tom Ogilvy

Need macro to change date from yyyymmdd format to mm/dd/yyyy forma
 
for each cell in selection
with cell
.value = datevalue(mid(.value,5,2) & "/" & Mid(.value,7,2) & "/" _
& mid(.value,1,4))
End with
Next

--
Regards,
Tom Ogilvy


"Iris" wrote in message
...
I received some data with the dates in a yyyymmdd format. Although I can

go
in and change this by splitting the data up with the text to column

option,
then concatenate the rows with a "/" in between them, I was wondering if
anyone has put together a macro to do this a bit faster than it takes to

go
through all of these other steps.

Thanks,
--
Acknowledge and Move on.




Ron de Bruin

Need macro to change date from yyyymmdd format to mm/dd/yyyy forma
 
Hi

No need for code

You can use Data Text to columns
next
next
choose YMD
to A1

Then change the format in column A what you want

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Iris" wrote in message ...
I received some data with the dates in a yyyymmdd format. Although I can go
in and change this by splitting the data up with the text to column option,
then concatenate the rows with a "/" in between them, I was wondering if
anyone has put together a macro to do this a bit faster than it takes to go
through all of these other steps.

Thanks,
--
Acknowledge and Move on.




iris

Need macro to change date from yyyymmdd format to mm/dd/yyyy forma
 
Never mind, I found out about the other text to column method where you
select the delimited option, then select the date format of ymd. It
automatically sets it to mm/dd/yyyy. :)
--
Acknowledge and Move on.


"Iris" wrote:

I received some data with the dates in a yyyymmdd format. Although I can go
in and change this by splitting the data up with the text to column option,
then concatenate the rows with a "/" in between them, I was wondering if
anyone has put together a macro to do this a bit faster than it takes to go
through all of these other steps.

Thanks,
--
Acknowledge and Move on.



All times are GMT +1. The time now is 01:09 AM.

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