Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Update a cell with a time.
HI All When the content of any of the cells in the range D4:F6 changes , I need the date and time to be placed in D10. Can someone help with some code please? Grateful for any advice. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Update a cell with a time.
Right click sheet tabview codeinsert thisformat d10 as desired.
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("d4:f6")) Is Nothing Then Exit Sub Range("d10") = Now End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Colin Hayes" wrote in message ... HI All When the content of any of the cells in the range D4:F6 changes , I need the date and time to be placed in D10. Can someone help with some code please? Grateful for any advice. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Update a cell with a time.
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim Cell As Range Const WS_RANGE As String = "D4:F6" If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then On Error GoTo endit Application.EnableEvents = False Me.Range("D10").Value = Format(Now, "mm/dd/yyyy hh:mm:ss") End If endit: Application.EnableEvents = True End Sub This is sheet event code. Right-click on sheet tab and "View Code". Copy/paste into that sheet module. Alt + q to return to Excel. Gord Dibben MS Excel MVP On Tue, 26 Jan 2010 23:13:15 +0000, Colin Hayes wrote: HI All When the content of any of the cells in the range D4:F6 changes , I need the date and time to be placed in D10. Can someone help with some code please? Grateful for any advice. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Update a cell with a time.
HI Thanks for the coding - I'm grateful. I experimented a little and find that it will not put the date and time where the cells in the specified range are updated from a remote source. It only works when I update manually directly onto the sheet. The cells D4:F6 are updated via formula referring to second worksheet in the same workbook. Can the code be modified to accommodate this? Best Wishes In article , Gord Dibben <gorddibbATshawDOTca@?.? writes Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim Cell As Range Const WS_RANGE As String = "D4:F6" If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then On Error GoTo endit Application.EnableEvents = False Me.Range("D10").Value = Format(Now, "mm/dd/yyyy hh:mm:ss") End If endit: Application.EnableEvents = True End Sub This is sheet event code. Right-click on sheet tab and "View Code". Copy/paste into that sheet module. Alt + q to return to Excel. Gord Dibben MS Excel MVP On Tue, 26 Jan 2010 23:13:15 +0000, Colin Hayes wrote: HI All When the content of any of the cells in the range D4:F6 changes , I need the date and time to be placed in D10. Can someone help with some code please? Grateful for any advice. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Update only at a specific time. | Excel Discussion (Misc queries) | |||
Update date & time in a cell only when worksheet is changed | Excel Discussion (Misc queries) | |||
Setting time of last update in a cell | Excel Discussion (Misc queries) | |||
Click a cell and update to current time / date ? | Excel Discussion (Misc queries) | |||
How do you continuously update time and date in an Excel cell? | Excel Worksheet Functions |