Я очень новичок в VBA. Ниже приведен мой код для идентификации и удаления только тех точек, которые появляются после дат, а не после текста. Но это не похоже на работу.
Sub simpleRegexSearch()
Dim strPattern As String: strPattern = "[0-9]+[\.]"
Dim strReplace As String: strReplace = "\."
Dim myreplace As Long
Dim strInput As String
Dim Myrange As Range
Set regEx = CreateObject("VBScript.RegExp")
Set Myrange = ActiveSheet.Range("A1")
For Each cell In Myrange
If strPattern <> "" Then
strInput = cell.Value
With regEx
.Global = True
.MultiLine = True
.IgnoreCase = False
.Pattern = strPattern
End With
If regEx.TEST(strInput) Then
Myrange.Value = (regEx.Replace(strInput, strReplace))
End If
End If
Next
Set regEx = Nothing
End Sub
Пример двух строк столбца, над которым я работаю:
08-02-18. BM sent email to Matt with IM. 15-02-18. Left voice message for Matt today.
08-02-18. BM sent email with IM. 15-2-18. BM spoke to Adam. He is looking at the IM. 16-2-18. Further discussions with Adam today. Looking to develop an office asset with Childcare.
Желаемый результат:-
08-02-18 BM sent email to Matt with IM. 15-02-18 Left voice message for Matt today.
08-02-18 BM sent email with IM. 15-2-18 BM spoke to Adam. He is looking at the IM. 16-2-18 Further discussions with Adam today. Looking to develop an office asset with Childcare.
Пожалуйста, помогите мне с исправлением в нем.