Hi all. I need to see if I can make this loop any faster, but first, I have a question regarding this. I don't know why I did
What does that mean? I just want to know when to use the "!" .. If I define any of those as an Integer or a Long, it rounds the final answer to a whole number...so I have to use the above in order for the loop to work correctly. Why is that?
Anyway, here is the loop. If someone can tell me how to make it run faster, I'd really appreciate that. Thank you!
Sub exp20()
Dim Temp!, pTemp!, ema!
Application.ScreenUpdating = False
LR = Cells(Rows.Count, "A").End(xlUp).Row
EMAp = 10
For i = 2 To LR - EMAp
Temp = 0: pTemp = 0:
For j = 1 To EMAp
Temp = Cells(i + j - 1, 7).Value
pTemp = pTemp + Temp
Next j
ema = pTemp / EMAp
Cells(i, 12).Value = ema
Next i
Application.ScreenUpdating = True
Bookmarks