Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

I need to create macros for current date and yesterday's date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sharyn K - 06 Nov 2004 20:29 GMT
in the format of mm/dd/yy.  I don't have much programming experience, is
there an easy way to go about this?  I created a macro for inserting today's
date using insert date, but it comes out 11/6/04 instead of 11/06/04 which is
the required format for my documents.

Thanks for any help.

Sharyn
Steve Yandl - 06 Nov 2004 22:01 GMT
Try something like this.

Sub DatesEnter()
Dim strToday As String
Dim strYesterday As String
strToday = "Today is " & Format$(Now, "mm/dd/yy")
strYesterday = "Yesterday was " & Format$(Now - 1, "mm/dd/yy")
Selection.InsertAfter strToday & vbCrLf & strYesterday
End Sub

Steve

> in the format of mm/dd/yy.  I don't have much programming experience, is
> there an easy way to go about this?  I created a macro for inserting
[quoted text clipped - 6 lines]
>
> Sharyn
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.