
14-12-2007, 15:33
|
|
|
|
חבר מתאריך: 07.10.06
הודעות: 1,795
|
|
אז הפעולה שאתה רוצה לעשות, זה להעיף את כל המיספרים? או לקבל את הערך עד המיספר? ביגלל שלא ציינת במה בדיוק אתה רוצה, אז הנה דוגמא להעיף את כל המיספרים:
קוד:
Dim Str As String
Dim loopCont As Integer
Str = א2"
For loopCont = 0 To 9
Str = Replace(Str, loopCont, "")
Next
Select Case Str
Case "א"
MsgBox "א"
Case "ב"
MsgBox "ב"
Case "ג"
MsgBox "ג"
End Select
הנה דוגמא לקבל את הערך עד המיספר:
קוד:
Dim Str As String
Dim intTheLeter As Integer
Dim LoopCont As Integer
Str = א2"
For LoopCont = 0 To 9
intTheLeter = InStr(1, Str, LoopCont)
If intTheLeter <> 0 Then
Str = Mid(Str, 1, intTheLeter - 1)
Exit For
End If
Next
Select Case Str
Case "א"
MsgBox "א"
Case "ב"
MsgBox "ב"
Case "ג"
MsgBox "ג"
End Select
|