PDA

View Full Version : Help with Replace Function



c19h28O2
06-12-2008, 05:33 AM
Hi,

I'm trying to use the replace function in VBA and would like to know if there is a way to only replace whole words. At the moment if I have a sentence with something like "condition on" and I wanted to replace "on" it replaces both cONdition and ON. Any ideas?

Thanks

mdmackillop
06-12-2008, 05:42 AM
Add spaces both ends
" on "

c19h28O2
06-12-2008, 05:48 AM
Simplest solutions are always the best! - Thanks :-)