+ Reply to Thread
Results 1 to 3 of 3

find and replace macro in excel 97

  1. #1
    Registered User
    Join Date
    09-06-2006
    Posts
    17

    Smile find and replace macro in excel 97

    Hi everybody.
    I'm kind of new in this forum and in macros.
    I need a macro to search and replace a word in a sheet.
    I'm using excel 97(I know! but i'm at work and you know the budget problems).
    I greatly appreciate any help.
    thanks in advance.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    The easiest way to start is to record a macro of you searching & replacing.

    Then if you need any modifications to the macro that you don't know how to do, post your code here and explain what you need to be modified.

  3. #3
    Forum Contributor
    Join Date
    11-11-2005
    Posts
    267
    Eg: to replace all instances of ALASKA with OHIO:

    Sub SearchAndReplace()
    Cells.Replace What:="ALASKA", Replacement:="OHIO", LookAt:=xlWhole, _
    SearchOrder:=xlByRows, MatchCase:=False
    End Sub

    Change LookAt:=xlWhole to[/B]LookAt:=xlPart and MatchCase:=False to MatchCase:=True as your circumstances warrant.
    HTH
    Myles

    ...constantly looking for the smoother pebble while the whole ocean of truth lies before me.

+ 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