Я очень новичок в 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.
пожалуйста, помогите мне с исправлением в нем.