VBA code to remain in the same page while running the macro

Balajibenz

Board Regular
Joined
Nov 18, 2020
Messages
80
Office Version
  1. 2013
Platform
  1. Windows
I have a VBA code with multiple subs and it has multiple worksheets which will be hided and only macro worksheet will be visible.

when someone runs the macro it will unhide the other worksheets and exports the output then at the end it hides the worksheets.

problem is at times towards the end of the code the workbook flickers and it showing the worksheets that are supposed to be not visible and once success message it shown and once i click on "ok" the it seems fine. I have used below lines but it is still the same.

Application.DisplayAlerts = False
Application.ScreenUpdating = False

can someone help me with this.

all i want it is to have only the worksheet named "Macro" visible while code is running.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You could maybe try to wrap it in another application setting.

VBA Code:
Sub FixFlickers()
    Application.Calculation = xlManual

    'your code here

    Application.Calculation = xlAutomatic
End Sub
 
Upvote 0
Are you activating / selecting the worksheets to work on them ??
It may be a better option to use With... End With stements to work on the sheet without selecting it.
Maybe if you posted some code that we could look at that adjusts a sheet other than the "Macro" sheet.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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