Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-09-2023, 05:23 PM
Guessed's Avatar
Guessed Guessed is offline Help with a complicated search macro Windows 10 Help with a complicated search macro Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

This will get you started.
Code:
Sub ShowDups()
  Dim aPar As Paragraph, sStart As String
  On Error Resume Next
  For Each aPar In ActiveDocument.Paragraphs
    If aPar.Range.Characters(2).Text = vbTab Then
      If Left(aPar.Range.Text, 2) = Left(aPar.Next.Range.Text, 2) Then
        aPar.Next.Range.HighlightColorIndex = wdBrightGreen
      End If
    End If
  Next aPar
End Sub
I put the error resume in because the loop would fail when looking for the paragraph after the last paragraph (and I couldn't be bothered complicating the code to deal with that).
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a complicated search macro macro to search * riccardo67 Word VBA 7 11-02-2018 07:43 AM
Help with a complicated search macro Complicated (to me) TOC andydavis Word 4 10-23-2017 02:06 PM
Complicated Macro - Capture from Excel sahrens1 Word VBA 2 06-25-2017 09:47 AM
Macro on Search and Replace davidhuy Word VBA 1 12-19-2014 04:47 AM
help with complicated formula flyinghigher2011 Excel 6 07-30-2013 02:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:46 AM.


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