excel freezing

  • Thread starter john.9.williams
  • Start date
J

john.9.williams

i have a problem, My program keeps freezing, the screen is half
userform and half spreadsheet at the point of freezing,

the code is as follow

Private Sub CommandButton7_Click()
Call mis

If Worksheets("display").Range("b3").Value = "" Then
MsgBox Title:="Reports program", PROMPT:="There Are No Records
Returned, Please Return To The Menu"
Exit Sub
End If
Worksheets("display").Range("a1") = "MIS Report"
Unload Me
End Sub

the program calls mis the code for this is

Sub mis()
Dim region
Dim webdata As Range
Set webdata = Worksheets("mis").Range("a1:w3000")

Application.ScreenUpdating = False
region = Worksheets("codes").Range("b12")
If region = ("No Filter Set") Then
webdata.Copy Destination:=Sheets("display").Range("a2")
Else
webdata.AutoFilter Field:=2, Criteria1:=region
webdata.Copy Destination:=Sheets("display").Range("a2")
webdata.AutoFilter Field:=2
End If


Worksheets("display").Select

Call bestfit

Application.ScreenUpdating = True
End Sub

It seems that the form is not unloading, the weird thing is that it
was working fine, and just started to freeze

hope someone can help
 
T

Tom Ogilvy

Try this:

Private Sub CommandButton7_Click()
Call mis

If Worksheets("display").Range("b3").Value = "" Then
MsgBox Title:="Reports program", PROMPT:="There Are No Records
Returned, Please Return To The Menu"
Exit Sub
End If
Worksheets("display").Range("a1") = "MIS Report"
Application.ScreenUpdating = True
Unload Me
DoEvents
End Sub
 
J

john.9.williams

Thanks, unfortunatley this did not help it just now seems to freezewith
just the form showing

regards

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top