ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Put only date (not time too) in variable from FileDateTime function (https://www.excelbanter.com/excel-programming/351098-put-only-date-not-time-too-variable-filedatetime-function.html)

mikeburg[_64_]

Put only date (not time too) in variable from FileDateTime function
 

What would be the syntx for the variable, dtFileDate to contain only the
date (not the time) from the FileDateTime function? For example put
1/21/2006 in the variable dtFileDate when FileDateTime is 1/21/2006
11:57:16 AM?

In other words, from:
dtFileDate = FileDateTime("C:\USR\MIKE\AT0158.MB")

I need dtFileDate to contain only the date 1/21/2006 (not the time
11:57:16 AM, too).

Thanks so very much. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=503681


Bob Phillips[_6_]

Put only date (not time too) in variable from FileDateTime function
 
dtFileDate = Int(FileDateTime("C:\USR\MIKE\AT0158.MB"))

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"mikeburg" wrote in
message ...

What would be the syntx for the variable, dtFileDate to contain only the
date (not the time) from the FileDateTime function? For example put
1/21/2006 in the variable dtFileDate when FileDateTime is 1/21/2006
11:57:16 AM?

In other words, from:
dtFileDate = FileDateTime("C:\USR\MIKE\AT0158.MB")

I need dtFileDate to contain only the date 1/21/2006 (not the time
11:57:16 AM, too).

Thanks so very much. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:

http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=503681




Gary Keramidas

Put only date (not time too) in variable from FileDateTime function
 
i've always just used format

Format(FileDateTime("C:\USR\MIKE\AT0158.MB"), "mm/dd/yy")

--


Gary


"mikeburg" wrote in
message ...

What would be the syntx for the variable, dtFileDate to contain only the
date (not the time) from the FileDateTime function? For example put
1/21/2006 in the variable dtFileDate when FileDateTime is 1/21/2006
11:57:16 AM?

In other words, from:
dtFileDate = FileDateTime("C:\USR\MIKE\AT0158.MB")

I need dtFileDate to contain only the date 1/21/2006 (not the time
11:57:16 AM, too).

Thanks so very much. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:
http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=503681




mikeburg[_66_]

Put only date (not time too) in variable from FileDateTime function
 

Thanks again, guys. If it were not for y'all, people like me would
probably give up trying to learn VBA. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=503681



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

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