ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro (https://www.excelbanter.com/excel-programming/411721-macro.html)

Still learning@work

Macro
 
I am importing information from an AS400 to an Excel spreadsheet. The date
imports as 20080528. Is it possible to write a macro that will insert the
date markers (/) at set intervals?

I have never written a macro but do understand the theory behind them. Any
help would be appreciate.



JW[_2_]

Macro
 
On May 29, 12:54*pm, Still learning@work
wrote:
I am importing information from an AS400 to an Excel spreadsheet. *The date
imports as 20080528. *Is it possible to write a macro that will insert the
date markers (/) at set intervals?

I have never written a macro but do understand the theory behind them. *Any
help would be appreciate.


If you are wanting to do this after the import, I would just use a
formula instead of a macro.
There are a few different ways to do this, but assuming 20080528 is in
E2.
=LEFT(E2,4) &"/" & MID(E2,5,2) & "/" & RIGHT(E2,2)

Still learning@work

Macro
 
How do I apply this formula to convert the entire column?
"JW" wrote:

On May 29, 12:54 pm, Still learning@work
wrote:
I am importing information from an AS400 to an Excel spreadsheet. The date
imports as 20080528. Is it possible to write a macro that will insert the
date markers (/) at set intervals?

I have never written a macro but do understand the theory behind them. Any
help would be appreciate.


If you are wanting to do this after the import, I would just use a
formula instead of a macro.
There are a few different ways to do this, but assuming 20080528 is in
E2.
=LEFT(E2,4) &"/" & MID(E2,5,2) & "/" & RIGHT(E2,2)


JW[_2_]

Macro
 
On May 29, 2:17*pm, Still learning@work
wrote:
How do I apply this formula to convert the entire column?



"JW" wrote:
On May 29, 12:54 pm, Still learning@work
wrote:
I am importing information from an AS400 to an Excel spreadsheet. *The date
imports as 20080528. *Is it possible to write a macro that will insert the
date markers (/) at set intervals?


I have never written a macro but do understand the theory behind them. *Any
help would be appreciate.


If you are wanting to do this after the import, I would just use a
formula instead of a macro.
There are a few different ways to do this, but assuming 20080528 is in
E2.
=LEFT(E2,4) &"/" & MID(E2,5,2) & "/" & RIGHT(E2,2)- Hide quoted text -


- Show quoted text -


Just drag the formula down as far as needed. It's references will
automatically change.


All times are GMT +1. The time now is 09:56 PM.

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