fredrerik84
Active Member
- Joined
- Feb 26, 2017
- Messages
- 383
Hi Ive been struggling with a search loop today
here is what I got:
Basically column Q have names stored and the same names are stored in column C
Im trying to search trough the names i column Q and find values that are stored in column F.
This code I have created works as long as there is no errors Ive tried to add some error handling to make it jump over search crteria that is not fund but so far no luck :/
Any help to fix or make this code faster would be greatly appreciated
here is what I got:
Code:
j = 4
x = 4
lr = Cells(Rows.Count, "C").End(xlUp).Row
search:
If j > lr Then
Exit Sub
End If
Ateam = Cells(j, "Q")
For i = 4 To lr
If Cells(i, "C").Value = Ateam Then
Cells(j, "V").Value = Cells(i, "F")
j = j + 1
GoTo search
End If
Next i
Basically column Q have names stored and the same names are stored in column C
Im trying to search trough the names i column Q and find values that are stored in column F.
This code I have created works as long as there is no errors Ive tried to add some error handling to make it jump over search crteria that is not fund but so far no luck :/
Any help to fix or make this code faster would be greatly appreciated