View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] mrlanier@hotmail.com is offline
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.