+ Reply to Thread
Results 1 to 8 of 8

Do Find & Replace multiple times using data in Col B for find & data in Col C for replace

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Do Find & Replace multiple times using data in Col B for find & data in Col C for repl

    Hi -

    Give a try using FIND method;

    Sub test()
    On Error Resume Next
    For Each r In Range("b8:b" & Cells(Rows.Count, 2).End(xlUp).Row)
        With Columns(1)
            Set c = .Find(r.Value, , , 2)
                If Not c Is Nothing Then
                    f = c.Address
                    Do
                        c.Value = Replace(c.Value, r.Value, r.Offset(, 1).Value)
                    Set c = .FindNext(c)
                    Loop Until f = c.Address
                End If
        End With
    Next
    End Sub
    Regards,
    event

  2. #2
    Forum Contributor
    Join Date
    07-02-2012
    Location
    Florida
    MS-Off Ver
    Home -Excel 2007, Work 2016
    Posts
    254

    Re: Do Find & Replace multiple times using data in Col B for find & data in Col C for repl

    It worked - Thanks
    BUT - I try to learn from you guys so I would like a tad bit more help here - PLEASE!
    If I wanted to use this other times - with other configurations - what is it that is now Column A, what is it that is now column B and what is it that is now column C?
    I tried to play with your solution by putting the data that is now in B & C into C & D and then changed your macro - changing each b to c and each c to d, but it did not run.
    Thanks

+ 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