Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Change format of NOW()

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Change format of NOW()

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Change format of NOW()

Format Custom as

m/dd/yyyy hhmm

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"ExcelMonkey" wrote in message ...
| 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 65
Default Change format of NOW()

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

Ed

On Mar 20, 12:20 pm, 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Change format of NOW()

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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Change format of NOW()

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
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
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Change Date Format to Specific Text Format When Copying [email protected] Excel Discussion (Misc queries) 4 December 23rd 08 03:43 PM
Use date modified to change format & create filter to track change PAR Excel Worksheet Functions 0 November 15th 06 09:17 PM
excel numbers in general format i cant add cant change format claude Excel Worksheet Functions 2 July 7th 06 08:18 PM
Change number (in text format) to numeric format Pam Excel Discussion (Misc queries) 5 October 24th 05 07:45 PM


All times are GMT +1. The time now is 01:12 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"