ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to suppress Time ? (https://www.excelbanter.com/excel-programming/276959-how-suppress-time.html)

Milind

How to suppress Time ?
 
In the FileDateTime(filename) command, how to suppress the Time ? Even if
column width is shortened, does not help.

Milind


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003



Tom Ogilvy

How to suppress Time ?
 
' remove the time portion
Range("A1").Value = clng(FileDateTime(filename))
Range("A1").NumberFormat = "dd/mm/yyyy"

or

' or just format it not to show
Range("A1").Value = FiledateTime(filename)
Range("A1").NumberFormat = "dd/mm/yyyy"

--
Regards,
Tom Ogilvy


Milind wrote in message
...
In the FileDateTime(filename) command, how to suppress the Time ? Even if
column width is shortened, does not help.

Milind


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003





Tom Ogilvy

How to suppress Time ?
 
Or FIX - negative numbers shouldn't be an issue - good thought. Thanks for
the Alert.

--
Regards,
Tom Ogilvy

Rob Bovey wrote in message
...
"Tom Ogilvy" wrote in message
...
' remove the time portion
Range("A1").Value = clng(FileDateTime(filename))
Range("A1").NumberFormat = "dd/mm/yyyy"


I'd be careful with CLng(), since it rounds. Int() would probably be
better.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *






All times are GMT +1. The time now is 11:18 AM.

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