E.g. change this:
For i = 1 To 1000
…do stuff
Next
to this:
For i = 1 To 1000
…do stuff
If i Mod 10 = 0 Then DoEvents
Next
In this example the code will briefly pause on every 10th iteration, while Excel checks for things like key presses. The “Mod” condition allows you to control how often it checks. If each iteration is slow then you may want to check more frequently, in which case you would replace 10 with a smaller number and vice versa.