מדריכים - VBA excel

3 נושאים 8 פוסטים
  • 9 הצבעות
    2 פוסטים
    381 צפיות

    והנה להוספה ללשון נקיה, וכן להוסיף מרכאות בין האותיות...

    Sub המרה() start: With Selection.Find .ClearFormatting .Execute findText:="[0-9]{1,}", MatchWildcards:=True, Format:=False, Wrap:=wdFindContinue If .Found = True Then S = "" MyArray = Array(400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) MyaArray = Array("ת", "ש", "ר", "ק", "צ", "פ", "ע", "ס", "נ", "מ", "ל", "כ", _ "י", "ט", "ח", "ז", "ו", "ה", "ד", "ג", "ב", "א") V = Val(Selection) Do While V > 0 If V = 15 Or V = 16 Then S = S & "ט" V = V - 9 End If For i = 0 To UBound(MyArray) If V >= MyArray(i) Then S = S & MyaArray(i) V = V - MyArray(i) Exit For End If Next i Loop If S = "רצח" Then S = "רחצ" If S = "רע" Then S = "ער" If S = "רעב" Then S = "ערב" If S = "שד" Then S = "דש" If S = "שמד" Then S = "שדמ" If S = "תשמד" Then S = "תדשם" If S = "רעה" Then S = "ערה" If S = "רעד" Then S = "עדר" If Len(S) = 1 Then S = S & "'" Else S = Left(S, (Len(S) - 1)) & Chr(34) & Right(S, 1) End If Selection = S GoTo start End If End With End Sub
  • 16 הצבעות
    1 פוסטים
    496 צפיות
    אין תגובות
  • 6 הצבעות
    5 פוסטים
    362 צפיות

    וכשתרצו להחליף בו זמנית מילים קבועים מראש, מספר מילים (דהיינו "או או") למילה אחת תשתמשו עם זה:

    Sub החלפת_כמה_מילים_למילה_אחת() ' ."פורסם על ידי מגדלים ב"מתמחים טופ arrFind = Array("א", "ב") For f = 0 To UBound(arrFind) Selection.Find.Text = arrFind(f) Selection.Find.Replacement.Text = "להחליף_ב" Selection.Find.Wrap = wdFindContinue Selection.Find.Execute Replace:=wdReplaceAll Next End Sub

    וכנ"ל להוסיף ולשנות למילים הנצרכים...
    בהצלחה רבה.