ник: Анатолий (Киев)
Function FindMaxDateInString(strText As String) As Date
Dim RegEx As Object, Matches As Object, i As Integer
Set RegEx = CreateObject("VBScript.RegExp")
RegEx.Pattern = "\d\d\.\d\d\.\d\d+"
' regEx.IgnoreCase = True
RegEx.Global = True 'True - все вхождения
Set Matches = RegEx.Execute(strText)
For i = 0 To Matches.Count - 1
If CDate(Matches(i).Value) > FindMaxDateInString Then
FindMaxDateInString = CDate(Matches(i).Value)
End If
Next
End Function
|
?FindMaxDateInString("1500шт - 30.06.2008 3000шт - 31.07.2008 3000шт - 31.08.08")
31.08.08
Это специально для вас.