Macro Or Formula Please

  steviegee 09:07 07 Sep 09

Is there a Macro or Formula that will look at a any number in column A and will replace it with another number in column B anywhere on another spreadsheet e.g on sheet 1 in A1 is ABC123 and in B1 is DEF123 so I want it to look for ABC123 anywhere on sheet 2 and replace it with DEF123 and so on down the rows. Thanks, hope its understandable!!

  VoG II 09:56 07 Sep 09

Sub test()
Dim LR As Long, i As Long
Dim F As Range, c As Range
With Sheets("Sheet1")
LR = .Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LR
Sheets("Sheet2").Cells.Replace What:=.Range("A" & i).Value, Replacement:=.Range("B" & i).Value, LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False
Next i
End With
End Sub

  steviegee 11:44 07 Sep 09

Thanks worked a treat.

This thread is now locked and can not be replied to.

Surface Pro (2017) vs Surface Pro 4

20 groundbreaking 3D animation techniques

How to mine Bitcoin on Mac