Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Naturesk
Femeie
25 ani
Bucuresti
cauta Barbat
25 - 47 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [WORD] Replace Specific Text only in Selection [VBA] Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 739
Source of inspiration:

The code below replaces bullet lists made manually with tab at 0,5 cm, - and space with nothing.



Sub ReplaceSpecificText()

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting

    With Selection.Find
        .text = "^t- "
        .Replacement.text = ""
        .Forward = True
    End With

Selection.Find.Execute Replace:=wdReplaceAll

End Sub


pus acum 5 ani
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 739

Sub ReplaceRisc()

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting

' replaces F1. F2. etc. until F9.
    With Selection.Find
        .Text = "F([0-9])."
        .Replacement.Text = "-"
        .Forward = True
        .MatchWildcards = True
        .Wrap = wdFindStop
        .Format = False
        .Execute Replace:=wdReplaceAll
    End With

End Sub



Sub ReplaceRisc2()

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting

' replaces F10. F11. etc. until F99.
    With Selection.Find
        .Text = "F([0-9][0-9])."
        .Replacement.Text = "-"
        .Forward = True
        .MatchWildcards = True
        .Wrap = wdFindStop
        .Format = False
        .Execute Replace:=wdReplaceAll
    End With

End Sub


Modificat de TRaP (acum 3 ani)


pus acum 3 ani
   
Pagini: 1  

Mergi la