Option Explicit
 
Dim lngI As Long
 
Dim sinFTime(1 To 2) As Single
Dim sinETime(1 To 2) As Single

Sub Speed_Test_If_IIf() Dim i As Integer Dim ii As Integer With Application .ScreenUpdating = False With .ActiveSheet For i = 3 To 12 Call TestA Call TestB For ii = 1 To 2 .Cells(i, ii + 1).Value = sinETime(ii) Next ii Next i End With .ScreenUpdating = True End With End Sub
Private Sub TestA() Dim i As Long Dim v As Variant sinFTime(1) = Timer For i = 1 To 30000000 If IsEmpty(v) Then lngI = 1 Else lngI = 0 Next i sinETime(1) = Timer - sinFTime(1) End Sub
Private Sub TestB() Dim i As Long Dim v As Variant sinFTime(2) = Timer For i = 1 To 30000000 lngI = IIf(IsEmpty(v), 1, 0) Next i sinETime(2) = Timer - sinFTime(2) End Sub