I have written the following code to test the efficiency of 3 different user definded functions. Looking at the results, runs 2 through 10 are taking about 30% longer to run than the 1st run. Is there something that can be done to fix this?
Code:
Sub Macro1()
Dim dtstart As Date
Dim iptr As Long
Dim I As Integer
For I = 1 To 10
dtstart = Now()
For iptr = 1 To 1000000
Sheets("Sheet1").Cells(1, 1).Value = iptr
Next iptr
Sheets("Sheet1").Cells(I, 13).Value = Now() - dtstart
Next I
End Sub