View Single Post
 
Old 06-04-2023, 10:15 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default

Fixed the scripts

Test this out.
Copy the below, and put the font size as the number prior to text.
Then copy the script and ask to change any font size of ''8 and below'', then run the script, It should color and highlight, everything except for the size 8.5 (since you will ask to find size 8 and below).

7
Sub FNR_SI_Format_Police_sous_Grosseur_7_met_grosseur_ 8p5_avec_variable()
'Works 2023-06-05
'CommentMania, original script name
'found here in forum :https://www.msofficeforums.com/word-...mes-sizes.html
'done by Guessed / Andrew Lockton 2018-06-13 at 9:00 am // modified by me 2023-06-05


7.5
Dim aRng As Range, aPara As Paragraph
Dim sVar1 As Variant 'Font Size IF below
Dim sVar2 As Variant 'Font Size TO change if found
Set aRng = ActiveDocument.Range


6.5
sVar1 = InputBox("Entre la grosseur de la police recherché si en bas de la grosseur désirée." _
& vbCr & "Pour des demi-points, met une virgule. Exemple : 7,5", "SUGGESTION", "7,5") 'pour les anglais, c'est point vs virgule 7.5 ENG / 7,5 FRE

sVar2 = InputBox("Entre la grosseur de la police à remplacé si trouvé en bas de...." _
& vbCr & "Pour des demi-points, met une virgule. Exemple : 9 ou 8,5", "SUGGESTION", "8,5") 'pour les anglais, c'est point vs virgule 8.5 ENG / 8,5 FRE


8.5
For Each aPara In aRng.Paragraphs

If aPara.Range.Font.Size <= sVar1 Then

Options.DefaultHighlightColorIndex = wdYellow


8
aPara.Range.Font.Size = sVar2
aPara.Range.HighlightColorIndex = wdYellow
aPara.Range.Font.ColorIndex = wdTeal
End If

Next aPara

End Sub

Let me know how it turns out for others

C
Reply With Quote