Macro Or Formula Please

  steviegee 09:07 07 Sep 09
Locked

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.

What is Amazon Go and will it come to the UK? The store without checkouts or queues

1995-2015: How technology has changed the world in 20 years

Hands-on with the Star Wars fighting drones you can fly yourself

iPhone 9 and beyond: 32 amazing future smartphone developments - graphene, supercapacitor…