Consulting

Results 1 to 3 of 3

Thread: Help with Replace Function

  1. #1
    VBAX Regular
    Joined
    Feb 2006
    Posts
    28
    Location

    Help with Replace Function

    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

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Add spaces both ends
    " on "
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Regular
    Joined
    Feb 2006
    Posts
    28
    Location
    Simplest solutions are always the best! - Thanks :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •