I wrote my own script. It works like a charm. My question you think?
Can it be cleaner, better or faster!
Please Login or Register to view this content.
I wrote my own script. It works like a charm. My question you think?
Can it be cleaner, better or faster!
Please Login or Register to view this content.
It certainly looks like a reasonable bit of code and unless it is in some sort of loop where it gets executed thousands of times, my suggestions won't save any noticeable amount of time, but here they are nonetheless.
First is to set a pointer to the sheets instead of using the sheet names themselves.
I do not know if this saves any time in code execution, but it does save typing and it does declutter the code. Also once set, the pointer remembers what workbook it belongs to, so if you have other workbooks open, you don't have to worry if sh is in the active workbook.Please Login or Register to view this content.
The other thing is that I don't like to do the same calculation more than once whether it be in code or in a formula on a worksheet. What I suggest as cleanup is
As I mentioned above, this probably won't matter unless you are doing it a thousand or so times.Please Login or Register to view this content.
At least it looks cleaner.
One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.
dflak,
Thanks for the reply. I changed it to
Is there a faster wat to unlock en lock several sheet i call in the macro.Please Login or Register to view this content.
Please Login or Register to view this content.
Last edited by jeffreybrown; 02-12-2019 at 08:57 PM. Reason: Removed full quote!
Found a script that run all sheets to protect and unprotect.
This is the macro now. Thanks all.
Please Login or Register to view this content.
See also this:
https://stackoverflow.com/questions/...dcmZSeU77gw&e=
That helpt a lot! Smoother and more protected.
3 week ago i didn't now what a macro or what VBA was. Nice dudes!!
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks