Hi,
I'm very new to VBA so this must be a very basic question. I've been trying for about 10 hours to get a simple Loop correct, which includes an If condition, but keeps returning an error saying 'For without Next'. Any help would be appreciated. Code below:
Private Sub Country() i = 2 Do Until i = 42000 For j = 2 To 250 If Application.WorksheetFunction.IsError(Application.WorksheetFunction.Search(Cells(j, 9), Cells(i, 2))) = True Then Next j Else: Cells(i, 3) = Cells(j, 9) End If Loop End Sub
Bookmarks