VBA - Search and Replace
Følgende stump kode fejler i linienFor Each Cell In Intersect(wsR.[A:A], wsR.UsedRange)
med meddelelsen "Run-time error '424': Object required"
Any idea why?
Sub SearchReplace()
Dim Cell As Range
Dim ws As Worksheet, wsR As Worksheet
Set ws = Sheets(1)
Set wsR = Sheets(2)
Application.ScreenUpdating = False
For Each Cell In Intersect(wsR.[A:A], wsR.UsedRange)
ws.Cells.Replace What:=Cell.Value, Replacement:=Cell.Offset(0, 1).Value, LookAt:=xlPart
Next Cell
Application.ScreenUpdating = True
End Sub
