![]() |
|
#1
|
|||
|
|||
![]()
Can I have your advice on this. I am working on VBA to look for a multiple text in table and highlight the corresponding rows. I am struggling with it. Can I have your advice?
|
#2
|
|||
|
|||
![]()
this is the code I have so far.This code helps me find the list of input "AAAA", "BBBB", "CCCC", "DDDD" and highlight the rows have that value. However; it only highlights the row has 1st input "AAAA", but not "BBBB", "CCCC", and "DDDD" row.
Sub FindMultiItemsInDoc() Dim objListDoc As Document Dim objTargetDoc As Document Dim objParaRange As Range, objFoundRange As Range Dim objParagraph As Paragraph Dim strFileName, arrM As String Dim arr() As String strFileName = InputBox("Enter the full name of the list document here:") arr = Split(strFileName, ",") For i = LBound(arr) To UBound(arr) arrM = arr(i) Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = arrM .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchWildcards = True .Execute End With Do While .Find.Found If .Information(wdWithInTable) = True Then .Rows(1).Range.HighlightColorIndex = wdYellow End If .Collapse wdCollapseEnd .Find.Execute Loop End With Application.ScreenUpdating = True Next i End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help, to Select all Rows with color Orange...... | Cendrinne | Word VBA | 0 | 02-08-2022 02:59 AM |
5000 rows, want to select and perform addition on ever 48 rows | Rexmaverick | Excel | 5 | 06-10-2019 06:29 AM |
Need to apply Heading1 to select rows | bobk544 | Word VBA | 3 | 06-09-2018 05:24 AM |
![]() |
LarryHills | Excel | 1 | 02-17-2017 03:55 PM |