![]() |
|
#2
|
||||
|
||||
|
Doing this would entail writing an application event procedure, for which see: https://wordmvp.com/FAQs/MacrosVBA/AppClassEvents.htm
and adding that to your document's template. Once you've done the basic setup, you'd insert the following code into the class module: Code:
Private Sub oApp_WindowSelectionChange(ByVal Sel As Selection)
If Sel.Information(wdWithInTable) <> True Then Exit Sub
If Sel.Tables(1).Range <> ActiveDocument.Tables(1).Range Then Exit Sub
Dim r As Long, c As Long
Application.ScreenUpdating = False
With Sel
r = .Cells(1).RowIndex
With .Tables(1)
If Len(.Cell(r, 1).Range.Text) > 2 Then Exit Sub
If r > 1 Then
If Len(.Cell(r - 1, 1).Range.Text) = 2 Then Exit Sub
If Len(.Cell(r - 1, 2).Range.Text) = 2 Then Exit Sub
End If
.Cell(r, 1).Range.Text = Format(Now(), "hh:mm:ss")
End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is it possible to put a formula in a table column header to define the name of the column? | JacquesW | Excel | 3 | 05-08-2017 08:00 AM |
Automatic, updated summary table in the end of document
|
tilde85 | Word | 4 | 02-14-2017 06:37 AM |
Automatic word updating in table
|
barnel | Word Tables | 2 | 06-07-2015 04:04 AM |
Problem with automatic table of contents
|
pogonoforysci1 | Word | 14 | 04-14-2013 10:39 PM |
Formatting automatic table of contents
|
1234msaps | Word | 3 | 10-31-2012 02:26 PM |