ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel freezing (https://www.excelbanter.com/excel-programming/354949-excel-freezing.html)

[email protected]

excel freezing
 
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


Tom Ogilvy

excel freezing
 
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

--
Regards,
Tom Ogilvy


wrote in message
ups.com...
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




[email protected]

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

regards

John



All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com