Sorry if the title is confusing, but let me try to explain what I am trying to do.
In a data sheet I have 2 columns of data. a1=apples b1=a, a2=oranges b2=b.
What I would like to do is run a macro on sheet 1 to find any instances of a1 from the data sheet and replace with b1 from the data sheet.
I have this macro which works fine, but I would like to use a data sheet to manage the find and replacement values for ease of editability.
Sub FindReplace()
Dim s As String
Dim cell As Range
For Each cell In Range("A2:G1000").Cells
s = cell.Text
Select Case s
Case "apples"
cell.Value = "a"
Case "oranges"
cell.Value = "b"
Case "pears"
cell.Value = "c"
End Select
Next cell
End Sub
Any help would be greatly appreciated.
In a data sheet I have 2 columns of data. a1=apples b1=a, a2=oranges b2=b.
What I would like to do is run a macro on sheet 1 to find any instances of a1 from the data sheet and replace with b1 from the data sheet.
I have this macro which works fine, but I would like to use a data sheet to manage the find and replacement values for ease of editability.
Sub FindReplace()
Dim s As String
Dim cell As Range
For Each cell In Range("A2:G1000").Cells
s = cell.Text
Select Case s
Case "apples"
cell.Value = "a"
Case "oranges"
cell.Value = "b"
Case "pears"
cell.Value = "c"
End Select
Next cell
End Sub
Any help would be greatly appreciated.