![]() |
#1
|
|||
|
|||
![]() Hi all, I'm trying to create a macro that will replace numerical values in only yellow highlighted text into 'x' for each character. At the moment my code only works for all highlighted texts not just yellow. How can I change this to make it only identify yellow highlighted texts? Any help is greatly appreciated! Code:
Application.ScreenUpdating = False Lookfor = "1234567890" Dim i As Long For i = 1 To Len(Lookfor) Lookchar = Mid$(Lookfor, i, 1) Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = Lookchar .Replacement.Text = "x" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = True .MatchAllWordForms = False .Highlight = True End With Selection.Find.Execute Replace:=wdReplaceAll Next Application.ScreenUpdating = True End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Thefirstfish` | Word VBA | 5 | 04-06-2017 07:18 PM |
![]() |
Aswinraj | Word VBA | 1 | 06-05-2016 04:33 PM |
![]() |
balaji | Word VBA | 10 | 03-24-2016 02:11 AM |
Find and replace BETWEEN numbers | WordUser2015 | Word | 4 | 12-19-2014 02:09 PM |
![]() |
bennymc | Word VBA | 1 | 01-27-2014 04:23 PM |