View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default A macro solution - replace text given the values

Sub ReplaceData()
Dim cell As Range
Dim res As Variant

With ActiveSheet

For Each cell In .UsedRange

On Error Resume Next
res = Application.VLookup(cell.Value,
Worksheets("Temp").Columns("A:B"), 2, False)
On Error GoTo 0
If Not IsError(res) Then cell.Value = res
Next cell
End With

End Sub


--
__________________________________
HTH

Bob

"Sinner" wrote in message
...
Hi,

I would like to have a macro to replace text in a sheet based on
values in another sheet.

Sample file is at:
http://www.savefile.com/files/1777260

Thx.