How to add a new worksheet without activating it

chamshop

New Member
Joined
Apr 8, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi there! Essentially everything I need is in the title, but for more details...

I have a VBA macro that creates new worksheets based on the data in my primary (controlling) worksheet. This is a requirement, unfortunately, so I can't just refuse to make the sheets. Sometimes the data in the primary worksheet is set up such that I end up creating 100 or more new worksheets. The sheets are created, and some of the data from the primary worksheet is moved to these new sheets.

My goal is to have these sheets created and populated in the background, so that Excel isn't constantly changing to these new sheets. I know I can set screen updating to false, but I want to keep it on so that I can watch as the macro marches down the length of the primary sheet.

Any ideas on how to keep these new sheets from being automatically activated? Thanks!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
As far as I know, you can't. The only option would be to create the new sheet & then select the master.
 
Upvote 0
Welcome to the board.

Any reason why you want to do it this way? Your end result is still a Master sheet and derived new sheets.

edit: + comments from#2
 
Upvote 0
Welcome to the board.

Any reason why you want to do it this way? Your end result is still a Master sheet and derived new sheets, containing data as defined.

edit: + comments from#2

It is just a lot of unnecessary switching, which causes the primary sheet to be unfocused. Maybe there's another method, other than "Add" to add new sheets?
 
Upvote 0
which causes the primary sheet to be unfocused
Why not select the Master sheet as last line of code to return focus back to it when macro stops?

May want to post your code to understand what it's doing..
 
Upvote 0
The only other option would be copy, but that also activates the sheet
That said if the sheet you copy is hidden, you might get away with it, depending on your code.
 
Upvote 0
That said if the sheet you copy is hidden, you might get away with it, depending on your code.
What if I create a standard blank sheet to use as a template, then hide it. Any copies of that sheet will also be hidden?
 
Upvote 0
If you make it the first sheet & then copy before sheet(1), yes.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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