Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-22-2020, 11:25 AM
gmaxey gmaxey is offline Macro to highlight only start of line, not past tab spaces (Word 97) Windows 10 Macro to highlight only start of line, not past tab spaces (Word 97) Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ReplaceAwithhighlightedtext()
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "A^t"
    Do While .Execute
      oRng.HighlightColorIndex = wdRed
      oRng.Collapse wdCollapseEnd
      oRng.HighlightColorIndex = wdAuto
    Loop
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to highlight only start of line, not past tab spaces (Word 97) start a macro with command Line startup switches Fesazu Word 3 02-08-2018 12:15 AM
Macro to highlight only start of line, not past tab spaces (Word 97) issue with highlight macro word 2010 jamesnavoy Word VBA 2 01-29-2017 08:32 AM
Macro to highlight only start of line, not past tab spaces (Word 97) macro to add brackets to each line and add single quotes to each word in the line bracketandquotes Word VBA 17 02-16-2015 03:51 PM
Macro to highlight only start of line, not past tab spaces (Word 97) Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM
Macro to highlight only start of line, not past tab spaces (Word 97) Macro to highlight text between 2 points in word 2010 jsilva1950 Word VBA 2 04-25-2013 12:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:41 PM.


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