Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lock Cell Format - Allow copy and paste of data without format change | Excel Worksheet Functions | |||
Change Date Format to Specific Text Format When Copying | Excel Discussion (Misc queries) | |||
Use date modified to change format & create filter to track change | Excel Worksheet Functions | |||
excel numbers in general format i cant add cant change format | Excel Worksheet Functions | |||
Change number (in text format) to numeric format | Excel Discussion (Misc queries) |