+ Reply to Thread
Results 1 to 3 of 3

Find and replace in excel

  1. #1
    Registered User
    Join Date
    01-13-2006
    Posts
    12

    Arrow Find and replace in excel

    I want to write a macro by which I can search a value 'DataA' in my excel sheet and replace it by value 'DataB'.

  2. #2
    Bondi
    Guest

    Re: Find and replace in excel

    Hi Reena,

    This is freshly recorded

    Sub Replace()
    Cells.Replace What:="DataA", Replacement:="DataB",
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    End Sub

    Regards,
    Bondi


  3. #3
    Mat P:son
    Guest

    Re: Find and replace in excel

    Or, in fact, if you don't actually have a particular need for a macro to do
    it then why not select the Edit > Find... menu item to bring up the Find and
    Replace dialogue. I'm convinced that you've seen it a million times before,
    but you may still be surprised over how feature-rich it actually is (e.g.,
    turn on the Advanced Mode by pressing the Options... button, and why not
    check out the Format search options as well).

    Not everything needs to be done programmatically :o) But if you want to,
    then by recording your actions as a macro naturally helps a lot while trying
    to figure out exactly what Excel objects to manipulate, and what params to
    use.

    Good luck Reena,
    /MP

    "Bondi" wrote:

    > Hi Reena,
    >
    > This is freshly recorded
    >
    > Sub Replace()
    > Cells.Replace What:="DataA", Replacement:="DataB",
    > LookAt:=xlPart, _
    > SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    > ReplaceFormat:=False
    > End Sub
    >
    > Regards,
    > Bondi
    >
    >


+ 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