screen updating = false

cmefly

Well-known Member
Joined
May 13, 2003
Messages
683
hi,

i've got a macro that unhide and hides sheets.

i'm using:

Application.ScreenUpdating = False
Application.EnableEvents = False

at the beginning....but when i run the macro i can still see the sheets being unhidden....

any way to not see this?

Marc
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
See if this works for you :

1- Add this API declaration at the top of your module :

Code:
Declare Function LockWindowUpdate Lib "user32.dll" _
(ByVal hwndLock As Long) As Long

2- Replace the line Application.ScreenUpdating with the API as follows :

Code:
Sub bringitalltogether()
'this macro brings all macros for collection together
 
[B][COLOR=Red]LockWindowUpdate Application.hwnd[/COLOR][/B]
Application.EnableEvents = False
 
 
Sheets("HIDDEN FINAL DVC").Visible = True
Sheets("HIDDEN FINAL DEF_VAR").Visible = True
Sheets("HIDDEN FINAL RATE RIDERS").Visible = True
Sheets("HIDDEN NETWORKING").Visible = True
Sheets("HIDDEN CONNECTING").Visible = True
 
 
IMPORT_DVC
IMPORT_PROPOSED_RR
IMPORT_DEF_VAR
IMPORT_networking
IMPORT_connecting
 
copyalldatatomainsheet
 
 
Sheets("HIDDEN FINAL DVC").Visible = False
Sheets("HIDDEN FINAL DEF_VAR").Visible = False
Sheets("HIDDEN FINAL RATE RIDERS").Visible = False
Sheets("HIDDEN NETWORKING").Visible = False
Sheets("HIDDEN CONNECTING").Visible = False
 
[COLOR=Red][B]LockWindowUpdate 0&[/B][/COLOR]
Application.EnableEvents = True
 
End Sub

Do the same with the other Macro.
 
Upvote 0
See if this works for you :

1- Add this API declaration at the top of your module :

Code:
Declare Function LockWindowUpdate Lib "user32.dll" _
(ByVal hwndLock As Long) As Long

2- Replace the line Application.ScreenUpdating with the API as follows :

Code:
Sub bringitalltogether()
'this macro brings all macros for collection together
 
[B][COLOR=Red]LockWindowUpdate Application.hwnd[/COLOR][/B]
Application.EnableEvents = False
 
 
Sheets("HIDDEN FINAL DVC").Visible = True
Sheets("HIDDEN FINAL DEF_VAR").Visible = True
Sheets("HIDDEN FINAL RATE RIDERS").Visible = True
Sheets("HIDDEN NETWORKING").Visible = True
Sheets("HIDDEN CONNECTING").Visible = True
 
 
IMPORT_DVC
IMPORT_PROPOSED_RR
IMPORT_DEF_VAR
IMPORT_networking
IMPORT_connecting
 
copyalldatatomainsheet
 
 
Sheets("HIDDEN FINAL DVC").Visible = False
Sheets("HIDDEN FINAL DEF_VAR").Visible = False
Sheets("HIDDEN FINAL RATE RIDERS").Visible = False
Sheets("HIDDEN NETWORKING").Visible = False
Sheets("HIDDEN CONNECTING").Visible = False
 
[COLOR=Red][B]LockWindowUpdate 0&[/B][/COLOR]
Application.EnableEvents = True
 
End Sub

Do the same with the other Macro.

Or you could completely lock it lollll.
You could still put Application.ScreenUpdating I think? or would it just be the same result except it's completely locked?
 
Upvote 0
What Kpark and Smitty are saying is, if your called macros have the correct sheet references within them, all you would need in the "bring them together " Sub would be
Code:
Sub bringitalltogether()
Application.EnableEvents = False
    IMPORT_DVC
    IMPORT_PROPOSED_RR
    IMPORT_DEF_VAR
    IMPORT_networking
    IMPORT_connecting
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,147
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top