View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] sbitaxi@gmail.com is offline
external usenet poster
 
Posts: 158
Default macro to make current date remain fixed

On Jul 31, 12:34*pm, line wrote:
Thank you sbi, I know about the copy paste special and that's why I'd like to
know if anyone has a macro idea to get around the copy paste special.

" wrote:
On Jul 31, 11:41 am, line wrote:
Hi,
I want to insert a current date into a cell, but then to have that date
remain fixed. *Basically, Im using an IF function to create a date in a cell
along the lines of IF(A2801000000000,NOW()). *The current date fills the
cell, but then changes the next day because of the internal clock.


Ideas?


CopyPaste SpecialValues
That will keep it fixed to that date, but it eliminates the formula
for the range you have replaced.


Do you want the Date to appear in the same column, or can it appear in
another column? If another, then you can capture on the Date column,
if blank, AND if A2801000000000 Then Now
Sub Dater()

Dim MyCell As Range

For Each MyCell In Range("A:A")
If MyCell.Value "5" Then
If MyCell.Offset(0, 1).Value = "" Then
MyCell.Offset(0, 1).Value = Now()
End If
End If
Next

End Sub

That will give you the current date/Time in the next column.