PC Review


Reply
Thread Tools Rate Thread

Change format of NOW()

 
 
=?Utf-8?B?RXhjZWxNb25rZXk=?=
Guest
Posts: n/a
 
      20th Mar 2007
When I use the NOW() function in VBA I get the current format:

3/20/2007 1:20:46 PM

How do I change this to get the following:

3/20/2007 1320

I need to get rid of the colon and lose the seconds.

Actually it would be interesting to know how to extract the formatting
imbedded int that as well. Is their a format property?

Thanks

EM
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      20th Mar 2007
I believe Now() returns the date and time using the format specified in your
computers regional settings. You can use the Format method to display
Now()'s return value in a different format.

Format(Now(), "mm/dd/yyyy hhmm")


--

Hope that helps.

Vergel Adriano


"ExcelMonkey" wrote:

> When I use the NOW() function in VBA I get the current format:
>
> 3/20/2007 1:20:46 PM
>
> How do I change this to get the following:
>
> 3/20/2007 1320
>
> I need to get rid of the colon and lose the seconds.
>
> Actually it would be interesting to know how to extract the formatting
> imbedded int that as well. Is their a format property?
>
> Thanks
>
> EM

 
Reply With Quote
 
Niek Otten
Guest
Posts: n/a
 
      20th Mar 2007
Format Custom as

m/dd/yyyy hhmm

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"ExcelMonkey" <(E-Mail Removed)> wrote in message news:F2E1BD32-8F7C-493A-8213-(E-Mail Removed)...
| When I use the NOW() function in VBA I get the current format:
|
| 3/20/2007 1:20:46 PM
|
| How do I change this to get the following:
|
| 3/20/2007 1320
|
| I need to get rid of the colon and lose the seconds.
|
| Actually it would be interesting to know how to extract the formatting
| imbedded int that as well. Is their a format property?
|
| Thanks
|
| EM


 
Reply With Quote
 
Ed
Guest
Posts: n/a
 
      20th Mar 2007
Format(Now(), "mm/dd/yyyy hhmm")

Ed

On Mar 20, 12:20 pm, ExcelMonkey
<ExcelMon...@discussions.microsoft.com> wrote:
> When I use the NOW() function in VBA I get the current format:
>
> 3/20/2007 1:20:46 PM
>
> How do I change this to get the following:
>
> 3/20/2007 1320
>
> I need to get rid of the colon and lose the seconds.
>
> Actually it would be interesting to know how to extract the formatting
> imbedded int that as well. Is their a format property?
>
> Thanks
>
> EM



 
Reply With Quote
 
merjet
Guest
Posts: n/a
 
      20th Mar 2007
Format(Now(), "m/d/yyyy hmm")

Suppose putting =Now() in an unformatted cell shows the imbedded
format. For me it is m/d/yyyy h:mm.

Hth,
Merjet



 
Reply With Quote
 
=?Utf-8?B?RXhjZWxNb25rZXk=?=
Guest
Posts: n/a
 
      22nd Mar 2007
Thanks all.

EM

"merjet" wrote:

> Format(Now(), "m/d/yyyy hmm")
>
> Suppose putting =Now() in an unformatted cell shows the imbedded
> format. For me it is m/d/yyyy h:mm.
>
> Hth,
> Merjet
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Date Format to Specific Text Format When Copying adambush4242@hotmail.com Microsoft Excel Misc 3 23rd Dec 2008 03:43 PM
How to change CONTACTS format on outlook 2003 to previous format =?Utf-8?B?Q2hhbmdpbmcgZm9ybWF0IG9mIGFsbCBjb250YWN0 Microsoft Outlook Contacts 3 15th Mar 2006 10:51 PM
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Microsoft Excel Worksheet Functions 1 11th Mar 2006 04:44 AM
Change file format to Access 2002-2003 format =?Utf-8?B?QW5kcmVhc00=?= Microsoft Access 3 19th Feb 2005 11:11 PM
make table query - change number format to text format Mark Microsoft Access Queries 1 13th Dec 2003 12:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:37 PM.