VBA to give address of changed cells from Find and Replace

  • Hi all,


    Hopefully a quick one. What is the easiest way to give the cell references of cells that are changed following a find and replace? The code below works fine, but I want to "report" the changes onto another sheet and just need the cell address.


    Code
    ThisWorkbook.Sheets("Data").Activate
    Rw = 2
    Do Until ThisWorkbook.Sheets("FindReplace").Cells(Rw, 1) = ""
    ThisWorkbook.Sheets("Data").Cells.Replace What:=ThisWorkbook.Sheets("FindReplace").Cells(Rw, 1), Replacement:=ThisWorkbook.Sheets("FindReplace").Cells(Rw, 2), LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
        Application.StatusBar = "Finding rows containing '" & ThisWorkbook.Sheets("FindReplace").Cells(Rw, 1) & "' and replacing with '" & ThisWorkbook.Sheets("FindReplace").Cells(Rw, 2) & "' on Data sheet."
       Rw = Rw + 1
     Loop
  • Re: VBA to give address of changed cells from Find and Replace


    Hi
    maybe use find function .. e once found replace and record the address



    example only

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!