I don't fully understaqnd what your code is doing
Ways to speed up your code
Avoid selecting cells, ranges etc
try replacing
Range("D" & (i + 10)).Select
Selection.FormulaArray = "=STDEV(QUARTILE(IF(('" & datasheet & "'!$K$2:$K$65500>0),'" & datasheet & "'!$D$2:$D$65500),2),QUARTILE(IF(('" & datasheet & "'!$K$2:$K$65500>0),'" & datasheet & "'!$D$2:$D$65500),3))"
With
Range("D" & (i + 10)).FormulaArray = "=STDEV(QUARTILE(IF(('" & datasheet & "'!$K$2:$K$65500>0),'" & datasheet & "'!$D$2:$D$65500),2),QUARTILE(IF(('" & datasheet & "'!$K$2:$K$65500>0),'" & datasheet & "'!$D$2:$D$65500),3))"
Loop through only used rows
'find last used row in column A
'change column letter to suit
lLR = Cells(Rows.Count, "a").End(xlUp).Row
For iLoop = 1 to lLR
your code here
Next iLoop
Turn off Autocalculate & Screen Updates at the start of the macro
Turn them back on at the end of the macro
Set a variable with the value of i + 10 & replace all the i + 10 with the variable
Bookmarks