ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   static automatic date (https://www.excelbanter.com/excel-programming/330271-static-automatic-date.html)

Jeanette

static automatic date
 
I want an automatic date generation in a particular cell when a value in the
cell adjacent to it is filled. But I want the date to be static, i.e. if it
is calculated it doesn't change. Can I do this with excel please?

Thanks

Bob Phillips[_7_]

static automatic date
 
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H1:H10")) Is Nothing Then
With Target
.Offset(0, 1).Value = Format(Date, "dd mmm yyyy")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--
HTH

Bob Phillips

"Jeanette" wrote in message
...
I want an automatic date generation in a particular cell when a value in

the
cell adjacent to it is filled. But I want the date to be static, i.e. if

it
is calculated it doesn't change. Can I do this with excel please?

Thanks





All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com