Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2013, 02:54 AM
tinfanide tinfanide is offline DateValue: How to have a capitalised "weekday"? Windows 7 64bit DateValue: How to have a capitalised "weekday"? Office 2010 32bit
Expert
DateValue: How to have a capitalised "weekday"?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default DateValue: How to have a capitalised "weekday"?

Code:
Sub EntryDate()

Dim sDate As String, sTime As String

// "DDD" only returns a small-letter weekday
sDate = Format(DateValue(Now()), "yyyy-mm-dd DDD")

sTime = Format(TimeSerial(Hour(Now()), Minute(Now()), Second(Now())), "hh:mm:ss")

Selection.Text = "(" & sDate & ", " & sTime & ")"

End Sub

Reply With Quote
  #2  
Old 01-17-2013, 07:32 AM
gmaxey gmaxey is offline DateValue: How to have a capitalised "weekday"? Windows 7 32bit DateValue: How to have a capitalised "weekday"? Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

It works here. Returning "Thu" here.

You code can be greatly simplified:

Sub EntryDateII()
Selection.Text = Format(Now, "yyyy-mm-dd DDD hh:mm:ss")
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 01-19-2013, 02:31 AM
tinfanide tinfanide is offline DateValue: How to have a capitalised "weekday"? Windows 7 64bit DateValue: How to have a capitalised "weekday"? Office 2010 32bit
Expert
DateValue: How to have a capitalised "weekday"?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
It works here. Returning "Thu" here.

You code can be greatly simplified:

Sub EntryDateII()
Selection.Text = Format(Now, "yyyy-mm-dd DDD hh:mm:ss")
End Sub
Sorry. I should have made it clearer.
I would like to return THU instead of Thu.
Thanks.
Reply With Quote
  #4  
Old 01-19-2013, 05:33 PM
fumei fumei is offline DateValue: How to have a capitalised "weekday"? Windows 7 64bit DateValue: How to have a capitalised "weekday"? Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Selection.Text = UCase(Format(Now, "yyyy-mm-dd DDD hh:mm:ss"))

As the day of the week is the ONLY alpha text, it becomes uppercase.
Reply With Quote
  #5  
Old 01-19-2013, 11:31 PM
tinfanide tinfanide is offline DateValue: How to have a capitalised "weekday"? Windows 7 64bit DateValue: How to have a capitalised "weekday"? Office 2010 32bit
Expert
DateValue: How to have a capitalised "weekday"?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Yes, thanks.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
'Linking' entered information to other "cells" from an original "cell" in MS Word Wade Word 6 09-03-2012 05:22 PM
NumberFormat: Capitalised Weekday Letters??? tinfanide Excel Programming 3 04-17-2012 04:46 AM
How to edit the "Format" and the "show level" of an EXISTING table of content? Jamal NUMAN Word 2 08-14-2011 10:46 AM
DateValue: How to have a capitalised "weekday"? How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM
"Microsoft Excel Application" missing in the "Component Services" on win08 sword.fish Excel 0 02-26-2010 02:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft