Thread: Help with macro
View Single Post
 
Old 03-04-2015, 02:16 PM
gmaxey gmaxey is offline Windows 7 32bit 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