Passively select cells in other worksheet

rmweaver81

New Member
Joined
Feb 4, 2013
Messages
15
I have written some code that runs about 400 lines of code in one worksheet, then 400 lines of code in another worksheet ("Calendar"), and finishes by returning to the first worksheet. When I run the code, it takes about a second to process. There is a flicker for about a quarter-second where you can see the "Calendar" worksheet. I am using slight deviations of the following code to switch between the worksheets:
Worksheets("Calendar").Cells(a,b).Select
With Selection
PerformAction
End With

Is there any way I can passively select those cells in the "Calendar" worksheet so that it doesn't become the active sheet? Is there a way I can suppress the script from flashing the "Calendar" sheet?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
The two sheets are actually both two different types of calendars. The only input to these calendars is the year. Using the year, I calculate all of the holidays and place them on the calendars. The first calendar is used to track the balance of your time off as you use it throughout the year. The second calendar shows the entire year with special shading for 4-day weekends and 3-day work weeks that occur when holidays land on certain days. So basically, I'm not moving any data around. It just takes half a second for the script to create the first calendar and half a second to create the second one. I just don't want to see the flash between as it is processing.
 
Upvote 0
i don't want to insult you. . . however have you tried using the application.screenupdating=false & True methods?

e.g.

Code:
application.screenupdating=false
'insert code here
application.screenupdating=true
 
Upvote 0
I'm new to programming, so no insult taken. I tried it out and it works perfectly! Thanks so much for your help!
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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