كود لاستخراج الارقام او الحروف من بين خليه بها حروف وارقام
استخراج الارقام
--------------
Function ExtractNumbers(ByVal inputText As String) As String
Dim result As String
Dim i As Integer
result = ""
For i = 1 To Len(inputText)
If IsNumeric(Mid(inputText, i, 1)) Then
result = result & Mid(inputText, i, 1)
End If
Next i
ExtractNumbers = result
End Function
Function ExtractNumbers(Value As String)
Dim StrLength As Integer
StrLength = Len(Value)
Dim i As Integer
Dim NumericChars As String
For i = 1 To StrLength
If IsNumeric(Mid(Value, i, 1)) Then NumericChars = NumericChars & Mid(Value, i, 1)
Next i
ExtractNumbers = NumericChars
End Function
استخرج الحروف
Function ExtractText(Value As String)
Dim StrLength As Integer
StrLength = Len(Value)
Dim i As Integer
Dim TextChars As String
For i = 1 To StrLength
If Not IsNumeric(Mid(Value, i, 1)) Then TextChars = TextChars & Mid(Value, i, 1)
Next i
ExtractText = TextChars
End Function
=TEXTJOIN(“”,TRUE,IFERROR(–MID(B2,ROW(INDIRECT(“1:”&LEN(B2))),1),””))
ليست هناك تعليقات:
إرسال تعليق