הפיכת אותיות למספרים באקסל
-
@אוריי זה עובד לי
האם עקבת אחרי ההוראות?
@פייתוניסט כתב בהפיכת אותיות למספרים באקסל:
תלחץ Alt + F11 תוסיף מודול ותדביק בתוכו את הקוד הבא
-
יש בעיה קטנה בקוד ש @פייתוניסט עשה, שהוא לא מטפל באותיות "טו" וב "טז"
אני עשיתי לעצמי תיקון לקוד
אז הנה השיתוף של הקוד לטבת המשתתפיםFunction GIMATRIA(x) G = "" TV = Int(x / 400) For i = 1 To TV G = G & "ת" Next i x = x - (TV * 400) TV = Int(x / 300) For i = 1 To TV G = G & "ש" Next i x = x - (TV * 300) TV = Int(x / 200) For i = 1 To TV G = G & "ר" Next i x = x - (TV * 200) TV = Int(x / 100) For i = 1 To TV G = G & "ק" Next i x = x - (TV * 100) TV = Int(x / 90) For i = 1 To TV G = G & "צ" Next i x = x - (TV * 90) TV = Int(x / 80) For i = 1 To TV G = G & "פ" Next i x = x - (TV * 80) TV = Int(x / 70) For i = 1 To TV G = G & "ע" Next i x = x - (TV * 70) TV = Int(x / 60) For i = 1 To TV G = G & "ס" Next i x = x - (TV * 60) TV = Int(x / 50) For i = 1 To TV G = G & "נ" Next i x = x - (TV * 50) TV = Int(x / 40) For i = 1 To TV G = G & "מ" Next i x = x - (TV * 40) TV = Int(x / 30) For i = 1 To TV G = G & "ל" Next i x = x - (TV * 30) TV = Int(x / 20) For i = 1 To TV G = G & "כ" Next i If x = 15 Then G = G & "טו" Else If x = 16 Then G = G & "טז" Else x = x - (TV * 20) TV = Int(x / 10) For i = 1 To TV G = G & "י" Next i x = x - (TV * 10) TV = Int(x / 9) For i = 1 To TV G = G & "ט" Next i x = x - (TV * 9) TV = Int(x / 8) For i = 1 To TV G = G & "ח" Next i x = x - (TV * 8) TV = Int(x / 7) For i = 1 To TV G = G & "ז" Next i x = x - (TV * 7) TV = Int(x / 6) For i = 1 To TV G = G & "ו" Next i x = x - (TV * 6) TV = Int(x / 5) For i = 1 To TV G = G & "ה" Next i x = x - (TV * 5) TV = Int(x / 4) For i = 1 To TV G = G & "ד" Next i x = x - (TV * 4) TV = Int(x / 3) For i = 1 To TV G = G & "ג" Next i x = x - (TV * 3) TV = Int(x / 2) For i = 1 To TV G = G & "ב" Next i x = x - (TV * 2) TV = Int(x / 1) For i = 1 To TV G = G & "א" Next i x = x - (TV * 1) End If End If GIMATRIA = G End Function