Oliver Dewar
Board Regular
- Joined
- Apr 17, 2011
- Messages
- 201
Hi All,
I have a macro that replaces a token in a string of text with the content of a cell. 99% of the time this works perfectly and the tokens are replaced.
Occasionally, excel decides it's going to replace every occurance of the token in the whole sheet! I've run this hundreds of times and it only happens once in every 300... odd.
Here's my code:
</P>
Is there any way to absolutely restrict the replace to that cell (S10)?
Or any suggestions as to what's going on?
I have a macro that replaces a token in a string of text with the content of a cell. 99% of the time this works perfectly and the tokens are replaced.
Occasionally, excel decides it's going to replace every occurance of the token in the whole sheet! I've run this hundreds of times and it only happens once in every 300... odd.
Here's my code:
Code:
Sheets("Admin").Range("S10").Replace "*TOKEN*
", Sheets("Admin").Range("O20").Value
Is there any way to absolutely restrict the replace to that cell (S10)?
Or any suggestions as to what's going on?