اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

فصل الارقام عن الاحرف


الردود الموصى بها

الدالة، تتطلب النص وترتيب الدرجة في النص 1 للأول 2 للثاني:
 

Option Explicit

Function GetDeg(ByVal inText As String, DegSeq As Byte) As Variant
  Dim Pos1 As Integer, Pos2 As Integer
  Dim Deg As Variant
  
  GetDeg = ""
  If DegSeq < 1 Or DegSeq > 2 Then Exit Function
  
  Do While InStr(1, inText, "  ") > 0
     inText = Replace(inText, "  ", " ")
  Loop
  
  Pos2 = InStr(1, inText, " درج")
  If Pos2 = 0 Then Exit Function

  If DegSeq = 2 Then
    Pos2 = InStr(Pos2 + 1, inText, " درج")
    If Pos2 = 0 Then Exit Function
  End If
  
  Pos1 = InStrRev(inText, " ", Pos2 - 1)
  If Pos1 > 0 And Pos2 > 0 Then
    Deg = Mid(inText, Pos1 + 1, Pos2 - Pos1 - 1)
  End If
  
  If IsNumeric(Deg) Then GetDeg = Val(Deg)
End Function

ضفه في ملفك أو انشئ ملف جديد ووحدة نمطية جديدة والصق الشفرة/الكود

تم تعديل بواسطه AbuuAhmed
  • Like 1
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information