ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SCREEN NOT UPDATING (https://www.excelbanter.com/excel-worksheet-functions/224662-screen-not-updating.html)

UB

SCREEN NOT UPDATING
 
Hi
I have a listbox in my sheet and a comadbutton that runs a macro.
I select a name from the list and click on command button.
I have application.screenupdating= False at the start of the macro and
application.screenupdating= true at the end of the macro.
but after the macro is done, and when I click on the list box, I am not able
to select an item from the list. I have to click on to the worksheet 2 or 3
times to be able to select from listbox.
Though If I dont have screenupdating commands in the macro, I am able to
select an item from list box after macro is done.
But since my macro opens and closes another workbook, I want screenupdating
set to false and then set to true.
Any advise what could be the problem


Rick Rothstein

SCREEN NOT UPDATING
 
I think you will need to show us your code. It could be you have and error
handling routine that gets executed and that is not where you turn
ScreenUpdating back on at; or you could have a test that executes Exit Sub
before the ScreenUpdating is turned back on... there is no way for us to see
what is happening without being able to see your code.

--
Rick (MVP - Excel)


"ub" wrote in message
...
Hi
I have a listbox in my sheet and a comadbutton that runs a macro.
I select a name from the list and click on command button.
I have application.screenupdating= False at the start of the macro and
application.screenupdating= true at the end of the macro.
but after the macro is done, and when I click on the list box, I am not
able
to select an item from the list. I have to click on to the worksheet 2 or
3
times to be able to select from listbox.
Though If I dont have screenupdating commands in the macro, I am able to
select an item from list box after macro is done.
But since my macro opens and closes another workbook, I want
screenupdating
set to false and then set to true.
Any advise what could be the problem



UB

SCREEN NOT UPDATING
 
my code is : ' This code in sheet "rev" of my workbook
**************
Application.ScreenUpdating = False

Application.Workbooks.Open _
"C:\CR\master 2009.xls"
Worksheets("Sheet1").Activate
nextrow = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
a1 = Worksheets("Sheet1").Range("b2", "d" & nextrow).Value
ActiveWorkbook.Save
Application.Workbooks("master 2009.xls").Close

For asmod = 1 To UBound(a1)
With Worksheets("rev")
If .Range("c2").Value = a1(asmod, 1)
asmod1 = asmod
Exit For
End If
End With
Next asmod

Application.Workbooks.Open _
"C:\CR\audit 2009.xls"

Worksheets("Sheet1").Activate
comment = ActiveSheet.Range("o2").Value

ActiveWorkbook.Save
Application.Workbooks("audit 2009.xls").Close
Application.ScreenUpdating = True

' value of comment stored in the sheet who called the procedure
worksheet("rev").range("m2").value = comment

***********************

"Rick Rothstein" wrote:

I think you will need to show us your code. It could be you have and error
handling routine that gets executed and that is not where you turn
ScreenUpdating back on at; or you could have a test that executes Exit Sub
before the ScreenUpdating is turned back on... there is no way for us to see
what is happening without being able to see your code.

--
Rick (MVP - Excel)


"ub" wrote in message
...
Hi
I have a listbox in my sheet and a comadbutton that runs a macro.
I select a name from the list and click on command button.
I have application.screenupdating= False at the start of the macro and
application.screenupdating= true at the end of the macro.
but after the macro is done, and when I click on the list box, I am not
able
to select an item from the list. I have to click on to the worksheet 2 or
3
times to be able to select from listbox.
Though If I dont have screenupdating commands in the macro, I am able to
select an item from list box after macro is done.
But since my macro opens and closes another workbook, I want
screenupdating
set to false and then set to true.
Any advise what could be the problem





All times are GMT +1. The time now is 03:44 PM.

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