See My Code Example:
Public Paused As Boolean
Public Function YourF()
'Supposse you have wrote codes here
Paused = True
Do While Paused
DoEvents ' If paused = true funtion is paused
Loop
'Code after pause
End Function
Public Function BreakPause()
Paused = False()
End Sub
'Please answer my question if you found