Let suppose you have 2 task in VBA and 1st task will take more time to finish, rather than waiting you can finish your 2nd task with the help of "DoEvents"
Try with below Example: -
1. Create a Form with "TextBox" and "2 Command Button"
'--Paste in Command Button 1 in FORM
Private Sub CommandButton1_Click() 'My 1st Task'
Dim i As Long
For i = 1 To 2000000
TextBox1.Text = i
'--Paste in Command Button 2 in FORM
Private Sub CommandButton2_Click() 'My 2nd Task'
I hope this will be helpful.....Kuldeep Singh 10 Dec 2017 0 0