+ Reply to Thread
Results 1 to 5 of 5

Search and replace VB with VB

  1. #1
    Forum Contributor
    Join Date
    08-19-2010
    Location
    UK.
    MS-Off Ver
    Excel 2007
    Posts
    142

    Search and replace VB with VB

    Does anyone know a way to search and replace a word in VB with VB?
    For example... run a macro to search through all the VB contained in a workbook and replace the word orange with the word lemon.
    Last edited by Mayweed; 03-14-2011 at 08:03 AM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Search and replace VB with VB

    Please Login or Register  to view this content.



  3. #3
    Forum Contributor
    Join Date
    08-19-2010
    Location
    UK.
    MS-Off Ver
    Excel 2007
    Posts
    142

    Re: Search and replace VB with VB

    Thanks Snb but I can't get it to work, I've attached a workbook to demonstrate what I mean.
    After running one macro, all messages containing the word 'Lemon' should read 'Orange'.
    Attached Files Attached Files

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Search and replace VB with VB

    You can't put this code in the same workbook you want to adapt.

  5. #5
    Forum Contributor
    Join Date
    08-19-2010
    Location
    UK.
    MS-Off Ver
    Excel 2007
    Posts
    142

    Re: Search and replace VB with VB

    Ahhh. now I've got it. Thanks Snb, just what I wanted.

+ 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