1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Option Explicit
Sub SelectionnerTexte()
Dim dteDate As Date
Dim intR As Integer, intI As Integer
intR = ActiveDocument.Tables(1).Rows.Count
For intI = 3 To intR
If NetText(ActiveDocument.Tables(1).Cell(intI, 5).Range.Text) = "" Then Exit For
dteDate = CDate(NetText(ActiveDocument.Tables(1).Cell(intI, 5).Range.Text))
If dteDate < Date Then ActiveDocument.Tables(1).Cell(intI, 5).Range.Font.Color = wdColorRed
Next intI
End Sub
Function NetText(stTemp As String) As String
NetText = Left(stTemp, Len(stTemp) - 2)
End Function |
Partager