Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-04-2015, 02:16 PM
gmaxey gmaxey is offline Help with macro Windows 7 32bit Help with macro Office 2010 (Version 14.0)
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

tingker, It looks like you want someone to write your macro for you. "I need help ..." implies you have tried and failed.

I'll give you some code to get you started:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim arrNums() As String
Dim lngIndex As Long
arrNums = Split("QHBB19VKSPW0NRLPU792|MRQFVW0WXN400MH9D416|JHURQ0VND7Q45PUBN011|RACAAYRWYBX840BJU005|" _
              & "PYZL7DR3NME4N5LEB490|CFWSPWA9MA96RS75K298|RYRXH35AK3BHFUGZN987|NPQVJ33EUY66QC0TD738|" _
              & "VLDTH09A33AKJ70NJ153|XWXWU30WZACA7CEBQ776|GTST08D3XR52JCCCE566|TVLCRCUPE6ELKC0U4018|" _
              & "TRYXRUWC3K2GA7249398|JKSG4XX7B4609ZB5K909|CYNFF3LERUXF2S9KS589|AZGRNTJC2HLJCJH4K507|" _
              & "JBPUKJ2JDYHN24R23272|VJPGVMP2JXX8J12EZ883|BUFQK2RMQHMQ5A4JF577|NQDTZ9DLLE8STZSN9996|" _
              & "QUZE112HEU5Q8AE5S194|HMXZQ7WTRNY2KSLBF035", "|")
Dim oRng As Word.Range
  lngIndex = 0
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Highlight = True
    While .Execute
      oRng.Text = arrNums(lngIndex)
      oRng.Collapse wdCollapseEnd
      lngIndex = lngIndex + 1
    Wend
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/

Last edited by gmaxey; 03-05-2015 at 08:38 AM.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with macro 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 Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM
custom icon, undo/redo for macro, permanent macro Rapier Excel 0 08-05-2013 06:30 AM
How do I assign a macro to a button when the macro is in my personal workbook? foolios Excel Programming 2 07-27-2011 02:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:58 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