Hi,
I have this code to lookup some values. But number of rows of the data is over 30K, so it takes years to run.
can help to advice what is the correct code to use instead?
Besides, how to set password for the VBA code, so that users will not access to it?
Thank you.
Sub LookupV1()
Sheets("Original").Select
i = 2
Do While Range("A" & i).Value <> ""
If Range("A" & i).Value = "F11" Then
Range("C" & i).Formula = _
Application.Vlookup(Sheets("Original").Range("B" & i).Value, Sheets("Loc").Range("B:C"), 2, False)
ElseIf Range("A" & i).Value = "D05" Then
Range("C" & i).EntireRow.Delete
Else
Range("C" & i).Formula = _
Application.Vlookup(Sheets("Original").Range("A" & i).Value, Sheets("Loc").Range("A:C"), 3, False)
End If
i = i + 1
Loop
End Sub
Bookmarks