Hello
I have a code that reads more than 100,000 records to do something. Since this takes about 1 minute, I have added a userform to show while code is running and unload it when done. However, the userform only shows for a few seconds and then it goes off and the screen is blank (with the little circle going around) until the work is done. I want the userform to stay and goes off until the work is done. Is something wrong with the placement of the userforms show and unload statements? I have tried to put the Unload at the very end just before the "end Sub" statement but still the same problem. Is it a problem of VBA coding or speed or memory of the hardware? Here is the example:
Code
Sub myfirstcode()
All DIM variables goes here
ActiveWorkbook.PrecisionAsDisplayed = False
[COLOR=#ff0000] ufWait.Show[/COLOR]
Application.ScreenUpdating = False
[COLOR=#ff0000] Unload ufWait[/COLOR]
Application.EnableEvents = False
Application.DisplayAlerts = False
CODE GOES HERE
ActiveWorkbook.PrecisionAsDisplayed = True
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
NOTE: I have also tried placing the Unload ufWait here and still the same problem
End Sub
Display More