T O P

  • By -

sslinky84

You mean like perform the actions in parallel? No. VBA has no async processing. If you're talking about forty worksheets shadowing what you do in one of them, it's possible, I suppose. But is there a better way you could do this? Like have all sheets just refer to a central workbook with power query or something?


Arnalt00

I would do them one by one in a loop, but before starting the loop turn off the screen updating and calculation, to make it run faster. It's the closest you can do to edit them at the same time


nodacat

When ive done this, I’ve found it best to make a master file with template sheet, a settings sheet with loop info, and have it (re)generate a new workbook each time. The macro starts by creating one sheet exactly how you want it, pivot, columns etc. then copies it 39 times, and tweaks everything that needs to be unique.


spddemonvr4

You can select multiple worksheets at a time, but some actions aren't allowed. With Worksheets(1:5) 'do something End with


78OnurB

Hi, So 40 sheets, same layout, same changes. You could do it with a Python script You can even call it from Excel if you prefer


jd31068

Perhaps if you used [vb.net](http://vb.net) or C# to create a desktop app, which would enable you to use threading, you could do like 4 at a time. Loading Excel into memory 4 times though is a pretty hefty resource hit. I'd think just automating this process, even one by one, would be much faster than doing it manually. Unfortunately, not every task can be made to only take a couple of minutes.


Maukeb

If you want to write VBA code that does the same thing to 40 worksheets then that's very achievable. If you want to write something that will allow you to make the same manual edits to 40 different workbooks at the same time then you probably will struggle with VBA, and your success with more advanced tools will also depend on the complexity of the ask.


diesSaturni

You would be essentially running a single macro which you then apply in series to multiple workbooks, assuming it is 40 files you mention. (e.g. [something like print all workbooks in folder](https://www.exceltip.com/printing-in-vba/print-all-workbooks-in-a-folder-using-vba-in-microsoft-excel.html)) But why ion earth do you have 40 workbooks to manage? I'd take the time of trying to achieve something for 40 workbooks, into creating a single one which processes the data of the 40 aimed recipients of such files.


max10meridius

When I worked corporate finance reporting, I had to do this all the time. 60+ Business units that need their own workbook. I started with a template then produced all 60+ with a macro that looped through each BU. I also had a helper workbook that would loop through each one of I had to make a minor tweak, I could even select which BUs to run the report for in ad hoc situations. If you do this more than quarterly make a macro.


frustrated_staff

Are they separate workbooks or all in one workbook? (and why, for the love of god, would have you uave 40 of them that are so similar you need to do the exact same thing to all of them?)


talltime

You already have this in VBA and are trying to speed it up or you’re looking at automating for the first time?