The macro automating the hyperlinks in Word - issue
Hi there,
(fantastic code by the way)
I finally got a full Excel template with the players in column A and their hyperlinks in column B. I ran the macro on my Word document after writing a column. There were approximately 30 player names mentioned. The macro went through and auto hyper-linked FIVE of them, leaving 25 not done.
I investigated why:
1. Upper/lower case was fine.
2. Spelling was fine
3. double checked for spacing, etc. Everything seems fine
So I went through to see what was linked vs what was not. It linked the players on lines:
59
296
317
815
852
That was it. So my first theory was that it only worked on the first 1000 lines (there are about 3000 lines in the Excel template). But I looked at some of the players not linked:
2602, 1255, 728, 381, 265, 855, 1656
There goes that theory. Then I found it.
The code was going through the Excel list line by line and checking in the Word doc for a match. When it found a match, it linked it. Then it would move onto the next player. BUT, it would pick up in the Word document where it left off. The first player found, from line 59, was on page 2. The next player found, line 296, was mostly down page 3. The next player was halfway down page 4, the next was just underneath that one. And the final player was the final player mentioned on the document, line 852.
Can the code be adjusted to start the check at the top of the document each time it loops? Thanks!
|