I would like to speed up this piece of code. The macro gets a search variable from the worksheet "RAW_DATA_ARCHIVE"
and then it should find it in the worksheet "RAW DATA"
. When it finds accordance then the value of column A from worksheet "RAW DATA"
will be written in the last column of "RAW_DATA_ARCHIVE"
.
For i = 2 To ws1LRow
SearchString = ws1.Range("A" & i).Value
Set aCell = ws2.Columns(5).Find(What:=SearchString, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
'If match found
If Not aCell Is Nothing Then
ws1.Cells(i, 80).Value = ws2.Cells(aCell.Row, 1).Value
End If
Next
VLOOKUP
can do for you? Try something like this in column 80 of sheet Raw_Data_Archive:=IFERROR(VLOOKUP(A2,'RAW DATA'!E:E,1,FALSE),"")
– Mat's Mug♦ Apr 10 at 13:30