View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default display date of today in cell X when number 0 in cell Y

hi,

i don't know if you know VBA, because for do what you must use an event code,
for the following code, i suppose that initially there's nothing in the cell Y
and i suppose that the cell's address X is "A1" and the cell's address Y is "B1"

you have to paste the following code into ThisWorkbook
and adapt range address, save and close the Workbook
the next time the Workbook will open, the code "Workbook_Open" will be execute

Private Sub Workbook_Open()
If Range("A1") 1 And Range("B1") = "" Then Range("B1") = Now: Range("B1").NumberFormat = "m/d/yyyy"
End Sub



--
isabelle