Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-25-2022, 10:52 PM
karkey karkey is offline able to find Windows 10 able to find Office 2013
Novice
able to find
 
Join Date: Jan 2021
Posts: 19
karkey is on a distinguished road
Default able to find

I need to find "Symbol" font "alpha" character and need to into "TimesNewRoman" font "alpha" character ... etc. as do the rest characters.
Reply With Quote
  #2  
Old 01-26-2022, 05:27 AM
karkey karkey is offline able to find Windows 10 able to find Office 2013
Novice
able to find
 
Join Date: Jan 2021
Posts: 19
karkey is on a distinguished road
Default Kindly Help

Find the attached sample file.
Attached Files
File Type: docx To Find Symbol font.docx (13.0 KB, 13 views)
Reply With Quote
  #3  
Old 01-26-2022, 09:22 PM
karkey karkey is offline able to find Windows 10 able to find Office 2013
Novice
able to find
 
Join Date: Jan 2021
Posts: 19
karkey is on a distinguished road
Default Please Help me on this

Is this possible or not Kindly update.
Reply With Quote
  #4  
Old 01-27-2022, 02:18 AM
gmayor's Avatar
gmayor gmayor is offline able to find Windows 10 able to find Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Based on code from Finding and replacing symbols the following will replace the alpha and beta characters with Times New Roman font. The font size is set to 14 so you can easily see that the font has been replaced. If that works for you delete the two font size lines. You can add any other Greek characters to the array as required.
Code:
Sub Macro1()
Dim vFindText As Variant
Dim i As Integer
    vFindText = Array(ChrW(-3999), ChrW(-3998))
    For i = 0 To UBound(vFindText)
        Call FindSymbols(FindChar:=CStr(vFindText(i)), FindFont:="Symbol")
    Next i
End Sub

Sub FindSymbols(FindChar As String, FindFont As String)

Dim FoundFont As String, OriginalRange As Range, strFound As Boolean
    Application.ScreenUpdating = False
    Set OriginalRange = Selection.Range
    strFound = False
    With Selection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = FindChar
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        Do While .Execute    'Keep going until nothing found
            If Dialogs(wdDialogInsertSymbol).Font = FindFont Then
                strFound = True
                Selection.Font.Name = "Times New Roman"
                Selection.Font.Size = 14
            Else
                Selection.Collapse 0
            End If
            strFound = False
        Loop

        If Not strFound Then
            'if nothing found, search from the beginning of the document
            ActiveDocument.Range(0, 0).Select
            Do While .Execute
                If Dialogs(wdDialogInsertSymbol).Font = FindFont Then
                    Selection.Font.Name = "Times New Roman"
                    Selection.Font.Size = 14
                    strFound = True
                Else
                    Selection.Collapse 0
                End If
                strFound = False
            Loop
        End If

    End With

    OriginalRange.Select

    Set OriginalRange = Nothing
    Application.ScreenUpdating = True

End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 01-27-2022, 02:51 AM
karkey karkey is offline able to find Windows 10 able to find Office 2013
Novice
able to find
 
Join Date: Jan 2021
Posts: 19
karkey is on a distinguished road
Default Shall we highlight

First of all Thanks for you Reply.

Shall we highlight instead of change font size.
Reply With Quote
  #6  
Old 01-27-2022, 02:55 AM
gmayor's Avatar
gmayor gmayor is offline able to find Windows 10 able to find Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

There is no need to change the size or highlight in order to change the font, however if you want highlight instead, change the two font.size lines to
Code:
Selection.Range.HighlightColorIndex = wdTurquoise
or whatever other highlight colour you prefer,
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
able to find Find What Text (^&) is not working for find Italic formatted strings Mercurial Word 5 06-29-2021 05:20 PM
How do you use the find and replace tool to find dates and times in Excel 2013? Jules90 Excel 3 04-14-2020 07:40 PM
find IP in range / find number between numbers gn28 Excel 4 06-14-2015 03:46 PM
able to find Find what box in Find and replace limits the length of a search term Hoxton118 Word VBA 7 06-10-2014 05:05 AM
able to find Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft