Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Code to add date


Excellent !

That worked like a charm. Thansk again!

I have another question, but this has no revelance to this topic so
will start a new topic

--
npereir
-----------------------------------------------------------------------
npereira's Profile: http://www.excelforum.com/member.php...fo&userid=1079
View this thread: http://www.excelforum.com/showthread.php?threadid=26998

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default VBA Code to add date

One note of caution using that on a template. Every time you open an invoice
made from that template the date will update to today's date and overwrite
the actual date the Invoice was created. I found this out the hard way
myself.
Mike F
"npereira" wrote in message
...

Excellent !

That worked like a charm. Thansk again!

I have another question, but this has no revelance to this topic so I
will start a new topic.


--
npereira
------------------------------------------------------------------------
npereira's Profile:

http://www.excelforum.com/member.php...o&userid=10799
View this thread: http://www.excelforum.com/showthread...hreadid=269988



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default VBA Code to add date

Good point.

If that's a concern to the OP:

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With Me.Worksheets("sheet1").Range("e11")
if .value = "" then
.Value = Date
.NumberFormat = "mmmm dd, yyyy"
end if
End With
End Sub

Checks what's in that cell first.

Mike Fogleman wrote:

One note of caution using that on a template. Every time you open an invoice
made from that template the date will update to today's date and overwrite
the actual date the Invoice was created. I found this out the hard way
myself.
Mike F
"npereira" wrote in message
...

Excellent !

That worked like a charm. Thansk again!

I have another question, but this has no revelance to this topic so I
will start a new topic.


--
npereira
------------------------------------------------------------------------
npereira's Profile:

http://www.excelforum.com/member.php...o&userid=10799
View this thread: http://www.excelforum.com/showthread...hreadid=269988


--

Dave Peterson

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
Code to conditional format all black after date specified in code? wx4usa Excel Discussion (Misc queries) 3 December 26th 08 07:06 PM
add 2nd Name and Date to Code Wanna Learn Excel Discussion (Misc queries) 2 August 15th 08 05:31 PM
Convert a julian gregorian date code into a regular date Robert Excel Worksheet Functions 3 June 13th 06 07:03 PM
code to convert date from TEXT format (03-02) to DATE format (200203) Gauthier[_2_] Excel Programming 0 September 22nd 04 03:26 PM
code pasting a date changes date format in current month only Edward[_5_] Excel Programming 0 May 10th 04 06:13 PM


All times are GMT +1. The time now is 10:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"