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

When user types in the letter Y in Column P, I want the next cell, in
Column Q to show the current date. I want that date to stay, and not
change tomorrow. So, the NOW function doesn't work for me.

I looked in here yesterday, and found what I thought was the answer. I
put this in a module.

Function DateAndTime()
DateAndTime = Now
End Function

When I tested it yesterday, it seemed to work ok. Of course I couldn't
tell until today, when the system clock changed. Today, I see the date
of 4/1 didn't hold. It now says 4/2.

Is there something else I can try? I can't change the system clock in
order to test it all out. I have to wait until the next day.
Please help!!
Thanks
j.o.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default date stamp to keep date

Hi,

Right click your sheet tab, view code and paste this in and you get a static
date in column q if Y is entered in col P

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 16 Or Target.Cells.Count 1 _
Or IsEmpty(Target) Then Exit Sub
If UCase(Target.Value) = "Y" Then
Target.Offset(, 1).Value = Date
End If
End Sub

Mike

" wrote:

When user types in the letter Y in Column P, I want the next cell, in
Column Q to show the current date. I want that date to stay, and not
change tomorrow. So, the NOW function doesn't work for me.

I looked in here yesterday, and found what I thought was the answer. I
put this in a module.

Function DateAndTime()
DateAndTime = Now
End Function

When I tested it yesterday, it seemed to work ok. Of course I couldn't
tell until today, when the system clock changed. Today, I see the date
of 4/1 didn't hold. It now says 4/2.

Is there something else I can try? I can't change the system clock in
order to test it all out. I have to wait until the next day.
Please help!!
Thanks
j.o.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default date stamp to keep date

On Apr 2, 8:58*am, wrote:
When user types in the letter Y in Column P, I want the next cell, in
Column Q to show the current date. I want that date to stay, and not
change tomorrow. So, the NOW function doesn't work for me.

I looked in here yesterday, and found what I thought was the answer. I
put this in a module.

Function DateAndTime()
DateAndTime = Now
End Function

When I tested it yesterday, it seemed to work ok. Of course I couldn't
tell until today, when the system clock changed. Today, I see the date
of 4/1 didn't hold. It now says 4/2.

Is there something else I can try? *I can't change the system clock in
order to test it all out. I have to wait until the next day.
Please help!!
Thanks
j.o.


OH, I forgot..... this range in Column Q is protected..... in case
this makes a difference.
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
Separating date from a Date & Time stamp JT Excel Discussion (Misc queries) 9 June 10th 08 05:55 PM
Date Stamp Leon Excel Worksheet Functions 2 September 12th 07 02:07 PM
Date Stamp Need Harvey Gersin Excel Worksheet Functions 3 July 2nd 06 07:13 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM
Date stamp spreadsheet in excel to remind me of completion date Big fella Excel Worksheet Functions 1 October 18th 05 04:10 PM


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