Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default only the date part

No time component, just the date. This seems a bit much. Is this how
it's done?

Dim dt As Date: dt = Now()
Dim justDate As Date: justDate = DateValue(DatePart("m", dt) & "/" &
DatePart("d", dt) & "/" & DatePart("yyyy", dt))
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default only the date part

Hi,

Am Sat, 23 Mar 2013 07:08:11 -0700 (PDT) schrieb oldyork90:

No time component, just the date. This seems a bit much. Is this how
it's done?


with Date you get only the date of today:
dt=Date


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default only the date part

Try

Dim myDate as String

TheDate = Now()
MyDate = Format(TheDate, "M/D/YYYY")

HTH
Mick.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default only the date part

Le 23/03/2013 15:57, Claus Busch a écrit :
Hi,

Am Sat, 23 Mar 2013 07:08:11 -0700 (PDT) schrieb oldyork90:

No time component, just the date. This seems a bit much. Is this how
it's done?


with Date you get only the date of today:
dt=Date


Or, for any date in dt:
justDate=Int(dt)
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
Unvaried date as part of a formula EMW103 Excel Discussion (Misc queries) 1 March 26th 09 06:11 PM
DATE as part of a formula EMW103 Excel Discussion (Misc queries) 14 January 29th 09 07:08 PM
Date & Phone Manipulation, Part 2 Ray S. Excel Discussion (Misc queries) 4 July 2nd 08 01:38 AM
Extracting Part of a Date GLT Excel Discussion (Misc queries) 2 November 23rd 05 12:04 AM
Look up part of a date Purfleet Excel Worksheet Functions 2 May 13th 05 12:44 PM


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