#1
|
|||
|
|||
VBA to highlight numbers from an excel list
I have inventory count sheets with inventory numbers which is in ms word and I need to take a long list of inventory numbers from an excel spreadsheet and by using VBA highlight those number on the ms word document.
Is that possible? Thanks Mike |
#2
|
||||
|
||||
For a bulk Find/Replace that uses an Excel workbook as the data source, see: https://www.msofficeforums.com/word/...html#post34254
With that code, you could simply delete the line: xlRList = xlRList & "|" & Trim(.Range("B" & i)) and replace: Code:
For i = 1 To UBound(Split(xlFList, "|")) .Text = Split(xlFList, "|")(i) .Replacement.Text = Split(xlRList, "|")(i) .Execute Replace:=wdReplaceAll Next Code:
.Format = True .Replacement.Highlight = True .Replacement.Text = "^&" For i = 1 To UBound(Split(xlFList, "|")) .Text = Split(xlFList, "|")(i) .Execute Replace:=wdReplaceAll Next
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to highlight a list of words | bakerkr | Word VBA | 4 | 10-19-2017 02:23 PM |
Highlight Words from a Word List | JSC6 | Word VBA | 1 | 09-30-2014 08:22 PM |
Highlight Numbers | Sharath_MS_Forums | Word VBA | 4 | 07-01-2014 07:55 PM |
Using macros to highlight worksheet words referenced in external list/doc. | Daniel_NYC | Word VBA | 1 | 04-21-2014 03:35 PM |
find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |