Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Exclude AM/PM from time format

Help please!

I want to append the date and time to a file name, which
is easy enough, but the trouble is, I want the time to
appear in "AM/PM" format and not show the "AM" or "PM".

The only way I know of to do this is to use a format like:

Format(Now(), "YYYY MM DD HH MM SS AM/PM")

I don't want the "AM" or "PM" to appear. Is there another
way to format the time as "AM/PM" so it doesn't show, or
do I need to crop those characters off using something
like the "Left" function?

I prefer a corrected format method, but I don't know what
it would be.

Your example code would be most helpful. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Exclude AM/PM from time format

I tried the code and excluded the AM/PM and it worked for me.


Cesar Zapata

"flawed" wrote in message
...
Help please!

I want to append the date and time to a file name, which
is easy enough, but the trouble is, I want the time to
appear in "AM/PM" format and not show the "AM" or "PM".

The only way I know of to do this is to use a format like:

Format(Now(), "YYYY MM DD HH MM SS AM/PM")

I don't want the "AM" or "PM" to appear. Is there another
way to format the time as "AM/PM" so it doesn't show, or
do I need to crop those characters off using something
like the "Left" function?

I prefer a corrected format method, but I don't know what
it would be.

Your example code would be most helpful. Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Exclude AM/PM from time format

Hi

Not much experience with this so I choose for the left function

Try this

Dim Str As String
Str = Format(Now(), "YYYY MM DD HH MM SS AM/PM")
ActiveWorkbook.SaveAs Left(Str, Len(Str) - 3)


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"flawed" wrote in message ...
Help please!

I want to append the date and time to a file name, which
is easy enough, but the trouble is, I want the time to
appear in "AM/PM" format and not show the "AM" or "PM".

The only way I know of to do this is to use a format like:

Format(Now(), "YYYY MM DD HH MM SS AM/PM")

I don't want the "AM" or "PM" to appear. Is there another
way to format the time as "AM/PM" so it doesn't show, or
do I need to crop those characters off using something
like the "Left" function?

I prefer a corrected format method, but I don't know what
it would be.

Your example code would be most helpful. Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Exclude AM/PM from time format

The hour is different Cesar (20 and 08)

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Cesar Zapata" wrote in message ...
I tried the code and excluded the AM/PM and it worked for me.


Cesar Zapata

"flawed" wrote in message
...
Help please!

I want to append the date and time to a file name, which
is easy enough, but the trouble is, I want the time to
appear in "AM/PM" format and not show the "AM" or "PM".

The only way I know of to do this is to use a format like:

Format(Now(), "YYYY MM DD HH MM SS AM/PM")

I don't want the "AM" or "PM" to appear. Is there another
way to format the time as "AM/PM" so it doesn't show, or
do I need to crop those characters off using something
like the "Left" function?

I prefer a corrected format method, but I don't know what
it would be.

Your example code would be most helpful. Thanks 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
How to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 4 February 13th 09 04:34 PM
How to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 1 February 13th 09 01:37 AM
How to type format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 1 February 13th 09 12:09 AM
Conditional Format (exclude 0) Ken Excel Discussion (Misc queries) 1 August 24th 07 06:42 PM
How to exclude weekends/holidays from plotted time series Debbie424242 Charts and Charting in Excel 3 January 19th 05 07:00 PM


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

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

About Us

"It's about Microsoft Excel"