Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2016, 07:03 AM
mbesspiata3 mbesspiata3 is offline VBA to highlight numbers from an excel list Windows 7 32bit VBA to highlight numbers from an excel list Office 2010 32bit
Novice
VBA to highlight numbers from an excel list
 
Join Date: Apr 2016
Posts: 5
mbesspiata3 is on a distinguished road
Unhappy 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
Reply With Quote
  #2  
Old 04-19-2016, 04:20 PM
macropod's Avatar
macropod macropod is offline VBA to highlight numbers from an excel list Windows 7 64bit VBA to highlight numbers from an excel list Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
with:
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]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to highlight numbers from an excel list Macro to highlight a list of words bakerkr Word VBA 4 10-19-2017 02:23 PM
VBA to highlight numbers from an excel list 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
VBA to highlight numbers from an excel list 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:34 AM.


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