السلام عليكم
Option Explicit
' بسم الله الرحمن الرحيم "
' ********************* "
' دالة استخراج النص او الارقام "
'=============================================="
' False = مهمل او Kh_Number اذا كان "
' تقوم باستخراج النص "
' True = Kh_Number اذا كان "
' تقوم باستخراج الارقام "
'=============================================="
'-----------------------------------------------------------------
Function Kh_Replace_Text(ByVal Kh_Sub As String, Optional Kh_Number As Boolean)
Dim Num As Byte, C As Integer
Dim Sn As String, Re As String, Md As String
Sn = Trim(Kh_Sub)
For Num = 0 To 9
Sn = Replace(Sn, Num, "")
Next Num
If Kh_Number Then
Re = Trim(Kh_Sub)
Do While C < Len(Trim(Sn))
C = C + 1
Md = Mid(Sn, C, 1)
Re = Replace(Re, Md, "")
Loop
Kh_Replace_Text = CDbl(Re)
Else
Kh_Replace_Text = Trim(Sn)
End If
End Function
دالة استخراج النص او الارقام.rar