+ Reply to Thread
Results 1 to 2 of 2

Search and replace text in cell with single character

  1. #1
    Registered User
    Join Date
    08-05-2011
    Location
    melbourne, austrlia
    MS-Off Ver
    Excel 2008 for mac
    Posts
    1

    Search and replace text in cell with single character

    Hi, I've been trawling through the net with no joy. I want to find instances of text strings within a column which is no problem using the find function. However, once found, i want to replace all of the contents of the cell with just one character.

    e.g. if i'm looking for "cand" and its found in a cell whose contents are " left candida albicans", i want to replace that cell with the number 1.

    Any help would put my struggling excel head to rest

    Thanks

    Philip

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Search and replace text in cell with single character

    This should do it:
    Please Login or Register  to view this content.
    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook

    The macro is installed and ready to use. Press Alt-F8 and select ReplaceAllSpecial from the macro list.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1