Data entry on very hidden sheets

dss28

Board Regular
Joined
Sep 3, 2020
Messages
165
Office Version
  1. 2007
Platform
  1. Windows
i have a program which has few sheets very hidden,

my program is running very slow and hence i am using following code at the start of the Sub or Private Sub

Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False

and following code at the end of the code
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True


even then my program is very slow and the screen flickers or if clicked anywhere on the form during this, the form goes blank / white and after 10-20 seconds, the code is executed.

my questions are:

1. since the sheets are very hidden on to which the data is getting stored, is it hindering the process and delaying the code execution?
2. Is any of the false and true application events as above hindering the speed of the code?
3. Am i required to add / delete any of the above application true / false codes??

please help
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
The very hidden sheet does not affect execution speed.

In my experience Application.ScreenUpdating = False during execution will negate under certain condition. I cannot recall due to what. This is why you get flickers. Some suggest using Windows API but you can get away by putting the same command line at specific location.

I think this is the main cause of your problem
 
Upvote 0
thanks for the prompt reply
1) should I add the Application.ScreenUpdating = False line in between the code lines, particularly where? -- after the codes performing calculation etc??
2) I am not aware of Windows API -- very new to vba / excel - request you to please guide
 
Upvote 0
thanks for the prompt reply
1) should I add the Application.ScreenUpdating = False line in between the code lines, particularly where? -- after the codes performing calculation etc??
2) I am not aware of Windows API -- very new to vba / excel - request you to please guide
I'm no expert either

I think if you performing copy paste between workbooks, the Application.ScreenUpdating = False will not longer work. It is hard to know because you cannot go step by step using F8. I think once you on pause on VBA Editor, the status is always True.

I am hoping someone with experience on this will reply to this. I'm in the dark myself on this subject ?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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