Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
n30
 
Posts: n/a
Default ability to embed a macro within a csv

situation: I am created a sceduled task within an ACCESS
dB to export out information to a .csv network file share.
The problem is that the date field is illegible it appears
in date-time format and when opened appears as
2.00512E+13. The ACCESS export is always writing over the
same file.

Is it possible to create a macro within this network file
share .csv which will format the columns, perform a LEFT
(datefield,8) on the date field trimming off the time so
that just the date appears as 20051231 and then format
this date field to appear as 12-31-2005 and then sort the
entire worksheet by date while assigning this macro to a
smiley face as a custom command on the toolbar also with
autoexec feature.

The objective being that all users throughout the network
will have a shortcut on their desktop pointing to the
network .csv file share so the macro is invoked upon
opening the file and the user can then look at a file
which makes sense vis-a-vis the date field.

Note: I attempted this but I was not able to save the
macro to the .csv. WHen I reopened the .csv I receive an
error message that the macro created cannot be found.

Thank you very much in advance!


  #2   Report Post  
Ron Coderre
 
Posts: n/a
Default

It seems to me that if the dates in the Access generated CSV were formatted
in m/d/yyyy format you wouldn't run into the problem. Excel would translate
the date-like text into actual Excel dates, then you wouldn't need any kind
of macro.

Is there a reason that can't be done?

Regards,
Ron


  #3   Report Post  
 
Posts: n/a
Default

This has not been possible to date but I will get back to
you after I recreate the ACCESS .csv export with actual
data. Unfortunately I do not have the actual export with
me and do not remember the format ACCESS is exporting out
the date-time in the csv file.

Thank you for such a quick response!


-----Original Message-----
It seems to me that if the dates in the Access generated

CSV were formatted
in m/d/yyyy format you wouldn't run into the problem.

Excel would translate
the date-like text into actual Excel dates, then you

wouldn't need any kind
of macro.

Is there a reason that can't be done?

Regards,
Ron


.

  #4   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

A csv file is not application-specific, and contains only text anyway, by
definition. So there's no way for a macro to be in it. This sounds like
Access is writing the date in a format that your Excel doesn't recognize as
a date (depends on your regional settings).

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"n30" wrote in message
...
situation: I am created a sceduled task within an ACCESS
dB to export out information to a .csv network file share.
The problem is that the date field is illegible it appears
in date-time format and when opened appears as
2.00512E+13. The ACCESS export is always writing over the
same file.

Is it possible to create a macro within this network file
share .csv which will format the columns, perform a LEFT
(datefield,8) on the date field trimming off the time so
that just the date appears as 20051231 and then format
this date field to appear as 12-31-2005 and then sort the
entire worksheet by date while assigning this macro to a
smiley face as a custom command on the toolbar also with
autoexec feature.

The objective being that all users throughout the network
will have a shortcut on their desktop pointing to the
network .csv file share so the macro is invoked upon
opening the file and the user can then look at a file
which makes sense vis-a-vis the date field.

Note: I attempted this but I was not able to save the
macro to the .csv. WHen I reopened the .csv I receive an
error message that the macro created cannot be found.

Thank you very much in advance!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
How can I embed a macro into a function in excel? Don Excel Worksheet Functions 2 January 28th 05 01:30 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"