Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Create a date that will not change

If a cell returns a certain value, can a date be made to appear in an
adjacent cell that will not change even if the first cell's value does
change with time. For example, if cell A1=1, then B1 shows the date
A1=1, even though A1 will eventually excede the value of 1 (therefore
A1=1). I need a date macro that will show only the first date A1=0.
Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Create a date that will not change

The macro in Worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1").Value = 1 And Range("B1").Value = "" Then
Range("B1").Value = Format(Now, "mm/dd/yyyy")
End If
End Sub

waits until A1 = 1 It then sets the current date in B1.

Once a date has been entered in B1 the macro will not change it.
--
Gary's Student


" wrote:

If a cell returns a certain value, can a date be made to appear in an
adjacent cell that will not change even if the first cell's value does
change with time. For example, if cell A1=1, then B1 shows the date
A1=1, even though A1 will eventually excede the value of 1 (therefore
A1=1). I need a date macro that will show only the first date A1=0.
Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Create a date that will not change

Thanks so much for the Christmas present. It works as expected.

Michael

Gary''s Student wrote:
The macro in Worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1").Value = 1 And Range("B1").Value = "" Then
Range("B1").Value = Format(Now, "mm/dd/yyyy")
End If
End Sub

waits until A1 = 1 It then sets the current date in B1.

Once a date has been entered in B1 the macro will not change it.
--
Gary's Student


" wrote:

If a cell returns a certain value, can a date be made to appear in an
adjacent cell that will not change even if the first cell's value does
change with time. For example, if cell A1=1, then B1 shows the date
A1=1, even though A1 will eventually excede the value of 1 (therefore
A1=1). I need a date macro that will show only the first date A1=0.
Thanks.



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
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Create vertical line to indicate date on chart with series of date ryguy7272 Charts and Charting in Excel 1 January 11th 08 06:36 PM
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
Create a date that will not change [email protected] Excel Discussion (Misc queries) 2 December 24th 06 08:11 PM
Use date modified to change format & create filter to track change PAR Excel Worksheet Functions 0 November 15th 06 09:17 PM


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