Find Cell Contents and Replace tihe Another Cell Contents

  • I would like to find the value in cell A1 in Range "Data" and replace with the cell Contents in A2.
    The Data Range is B1. Z20, I have "x" in A1 and 2 in A2 and would like to replace all x's as identified in A1 with the value in A2 which is 2.

  • Re: Find Cell Contents and Replace tihe Another Cell Contents


    Hi John. Try:

    Code
    Sub ReplaceCell()
        Application.ScreenUpdating = False
        Dim rng As Range
        For Each rng In Range("B1:Z20")
            If rng = Range("A1") Then
                rng = Range("A2")
            End If
        Next rng
        Application.ScreenUpdating = True
    End Sub

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

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