我有一些类似的文字:
27/05/2019 16:02:56-Yassine Aboulaila(注意事项)Oui,tu 佩克斯使者。 @CécileDESCHAMPS:土伊人之光,土伊人 必威投注网埃勒哈桑·波黑德·比尔·丹斯 IHMTélejauge。 Cordialement。 Yassine。 27/05/2019 15:42:20-亚历山大 利索(旅行说明)Yassine Dois je renvoyer le票务客户 Merci de ton游览27/05/2019 11:53:28-Yassine Aboulaila(注意de travail)宜必思尚乐团BIR
我想使用VBA删除日期之间的文本。
我希望所有日期都作为输出。
答案 0 :(得分:0)
尝试该宏,它将删除除日期以外的所有内容:
Sub DeleteChar()
Dim i As Integer
Dim strSource As String
Dim strResult As String
strSource = "27/05/2019 16:02:56 - Yassine Aboulaila (Notes de travail) Oui, tu peux l'envoyer. @ Cécile DESCHAMPS : Si tu aurais besoin du BIR, tu pourrais faire un mail à Elhassane pour te débloquer le BIR dans IHMTélejauge. Cordialement. Yassine. 27/05/2019 15:42:20 - Alexandre Lizeau (Notes de travail) Yassine Dois je renvoyer le ticket au client Merci de ton retour 27/05/2019 11:53:28 - Yassine Aboulaila (Notes de travail) la variance du BIR sur le groupe est désormais OK"
For i = 1 To Len(strSource)
Select Case Asc(Mid(strSource, i, 1))
Case 48 To 57, 47, 32:
strResult = strResult & Mid(strSource, i, 1)
strResult = Left(strResult, 10)
End Select
Next
AlphaNumericOnly = strResult
MsgBox AlphaNumericOnly
End Sub