I'm calling a subroutine and while the code is running, I would like to inform the user of what is happening. So I have a small UserForm that pops up and I want to change the caption of a label. The problem is that once I invoke the form, the code stops running. I suspect I need a DoEvents, but am not sure how to use it. The following is a snippet of my code:
Code:
'**** CALL TO THE SUB WITH USERFORM POP_UP ****
Private Sub cboFrom_Change()
cboProdGrp.Clear
FillComboProdGrp
cboProdGrp.ListIndex = -1
End Sub
"**** SUB WITH USERFORM POP_UP ****
Sub FillComboProdGrp()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
frmMsg.Show
' [CODE STOPS RUNNING HERE]
frmMsg.lblMsg.Caption = "Applying advanced filter."
' CODE INSERTED HERE
frmMsg.lblMsg.Caption = "Removing duplicates."
' CODE INSERTED HERE
frmMsg.lblMsg.Caption = "Sorting results."
' CODE INSERTED HERE
frmMsg.Hide
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub