![]() |
#1
|
|||
|
|||
![]()
Hi, I've got a macro to highlight the start of each line in my document.
A(tab space here)(tab space here) Text The problem is when there's no text after the tab spaces (when I haven't typed anything else on that line yet), it highlights the whole line, which means when I go on to that line to type, the text I type is highlighted. Is there a way I could get it to not highlight past the tab spaces? Here is my current macro: Sub ReplaceAwithhighlightedtext() With Selection.Find .Text = "A^t" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = True .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Forward = False Do While .Execute Selection.Range.HighlightColorIndex = wdRed Loop End With Application.Run MacroName:="Normal.NewMacros.ClearFindAndReplacePa rameters" End Sub It extends past the tab spaces, which I'm not sure how to fix. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Fesazu | Word | 3 | 02-08-2018 12:15 AM |
![]() |
jamesnavoy | Word VBA | 2 | 01-29-2017 08:32 AM |
![]() |
bracketandquotes | Word VBA | 17 | 02-16-2015 03:51 PM |
![]() |
LadyAna | Word | 1 | 12-06-2014 10:39 PM |
![]() |
jsilva1950 | Word VBA | 2 | 04-25-2013 12:21 AM |