Hi all
I have this code :
Sub oldhome_homev2()
Application.ScreenUpdating = False
Dim i As Integer
i = 0
Do While Cells(21 + i, 31).Value <> ""
i = i + 1
If Application.WorksheetFunction.CountIf(Range("ai:ai"), (Cells(21 + i, 31)) > 0) Then
Cells(21 + i, 37).Value = 55
Else
Cells(21 + i, 37).Value = Application.WorksheetFunction.CountIf(Range("ai:ai"), (Cells(21 + i, 31)))
End If
Loop
End Sub
what it should do :
look if (Cells(21 + i, 31) exists in range ( ai:ai) ( i opted to do a countif , either its found so count is > 0 or not) -- if count > 0 then it should put value " 55 " in the cells if count < 0 then simply show the counted value
somehow it always skips the first part of the if/ else condition and always applies the second part..
dont understand why
Bookmarks