Let me know in the comments below if you would like more videos like this👇
@mikheilchigogidze42249 ай бұрын
This is great. Thanks a lot! Can you please do a video, on how would you schedule an excel macro? Macro to run without opening an excel.
@jastonkong14099 ай бұрын
Your work is very inspiring. You keep me interested in learning VBA. Thank you so much for such selfless sharing! Also, never in a million year i would have thought that simple line of clearing contents could cause that much trouble! lol
@sweetdreams66978 ай бұрын
I loved it
@luiss.l79048 ай бұрын
There is still one thing to work on: combined = data(i,2) & data (i,3) e data(i,4) has a N level of complexity This concatenation operation is done N(loop size) times unecessarily. Use worksheet function to vectorially create a single array with the already concatenated values of all rows.
@markd.95388 ай бұрын
This idea would have come in very handy for me about 4 years ago. I had to write complex (similar to this, but but non-trivial) scripts that ran across invoice support templates that checked and updated columns to the customer's very specific demands. The code had to look across about 120 columns of data, and the spreadsheets contained hundreds of thousands of rows. In the end it all worked but we had the same problem: the constant updates to the sheet during the process slowed it down to a crawl. Come due day, it would eat a huge chunk of the day for the person running and checking it. If I ever have to implement (or refactor) anything like this in the future, I'm going to be doing it your way! Thank you for the great advice here.
@HSkraekelig9 ай бұрын
Paul, I've been using your web site for hints and tricks for years now. I probably would have stopped at the first fix, but the second is 200% more brilliant. Don't change what doesn't need changing! More please.
@Excelmacromastery9 ай бұрын
Glad you liked it
@Info-God9 ай бұрын
The most efficient combination. Dictionaries+Arrays.
@eshaich8 ай бұрын
Pro as usual. btw I believe you can do it even faster with the "evaluate" VBA function. no loops and it does the calculation for all the range ows at once.
@dantealighieri80319 ай бұрын
You make excel coding very enjoyable to learn. i dont even know half of what you did but it was intriguing.
@Excelmacromastery9 ай бұрын
Thanks. Glad you like it.
@Info-God9 ай бұрын
Dictionaries are a just like that: an array organised as you look at a ... dictionary. Try to organise a set of data as a ... dictionary....unique items.
@RobertWoodman8 ай бұрын
That was quite impressive, Paul. I use your KZbin site often for ideas, tips, and tricks.
@RobGijrath9 ай бұрын
That is very efficient. Please show us more videos like this.
@Excelmacromastery9 ай бұрын
Thanks Rob
@stevegarside50269 ай бұрын
Fantastic coding and described in a way that people can understand. Thanks for sharing!
@Excelmacromastery9 ай бұрын
You're welcome
@Tocotronic0000009 ай бұрын
Fantastic tutorial. We need more like this. Keep up the excelent Work. Greetings from germany
@Excelmacromastery9 ай бұрын
Glad you like it
@hammeedabdo.829 ай бұрын
Thank you Paul, we need more videos like this.
@Excelmacromastery9 ай бұрын
Glad you like it
@barrygeldham3909 ай бұрын
Very interesting Paul. Just a rather pedantic point, 2.8 million percent is not 2.8 million times faster, only a mere 28,000 times faster. Still quite impressive.
@elecirlisboa91559 ай бұрын
Excelente vídeo parabéns, aprendi como reduzir o tempo em algumas macros, obrigado!!
@BrittKinsler9 ай бұрын
Excellent video and looking forward to more! Thanks!
@Elesario9 ай бұрын
An alternative solution would be to set up a temporary column with a function that can detect whether the item is the first of the group or not, and then use that column to filter the data and clear the visible cells in the first column. Then it's simple to remove the filter and the helper column. It would work best with the calculation mode set manual and triggering the calculation for only the point prior to filtering. In the example provided it's unlikely to be faster, but it might scale better (haven't tested). The reason I suggest this is because moving data between the Excel and VBA engines can be slow, so sometimes you get better performance directly from the Excel calculation system (which is multithreaded), and you're only pushing a few commands at it from VBA's side.
@stevec18357 ай бұрын
Awsum, thanks for taking the time to make these videos. They are so helpfull...
@joeburkeson89469 ай бұрын
Easier & faster what's not to like? Another fine tutorial with real world application, thanks.
@Excelmacromastery9 ай бұрын
You're welcome
@nadermounir82289 ай бұрын
Brilliant video Thank you very much for your effort and for showing us a real world example. I am currently enrolled in your course (just started)
@Excelmacromastery9 ай бұрын
Thanks. Glad you like it.
@janezklun8 ай бұрын
Thank you Paula for such useful videos, yes more
@kapibara24409 ай бұрын
Smart and clean. Great work Paul! Your videos are valuable 🎉
@Excelmacromastery9 ай бұрын
Thanks
@Excelmacromastery9 ай бұрын
Thanks
@ΕλευθέριοςΠάντος9 ай бұрын
That was splendid indeed! Thank you very much!
@Excelmacromastery9 ай бұрын
Thanks
@ganeshs13606 ай бұрын
Very well presented. I have a question. Is vbnullstring faster than using ""?
@Bhuvan_C_Paranji9 ай бұрын
Hi Paul, I have one issue from Power Bi data, Its taking long time to execute. please give me any idea to lessthan 1 minute to get the power bi data with filter options.
@brianminder25619 ай бұрын
Excellent! I vote for more.
@Excelmacromastery9 ай бұрын
Thanks Brian
@egozMaster8 ай бұрын
you should remove the With statement as well
@dermotbalson9 ай бұрын
My preference is never to overwrite any original data, both because making an error may lose it forever, and also because in business, work needs to be checked, and you can't do that without the original data.
@notaras19858 ай бұрын
There's zero reason the data will be lost
@aslamfaleel87Ай бұрын
Hi Paul, Thank you firstly for the Awesome Video and the Work that you do! Quick Question. What's the Reason to include a Resize code in there? 1. rg.Offset(1) already selects the Data without the Header. Hence we can define data = rg.Offset(1) ignore the "Resize(rg.Rows.Count - 1)" code coming after? 2. When you assign: data = rg.Offset(1).Resize(rg.Rows.Count - 1), I feel like there is nothing in there that it does that is more than the rg.Offset(1) code Can you kindly explain! Much appreciated :)
@iincitr9 ай бұрын
Amazing. Thank you.
@Excelmacromastery9 ай бұрын
You're welcome
@strannostrannovasrr9 ай бұрын
Is it possible to dump only 1 column from a multi column variant array on a worksheet at once? I mean without using a for-next-loop?
@Excelmacromastery9 ай бұрын
You can only do it with the first column. Resize the output range to the size of this column. Range(rowCount,1) = arr
@benlinford_work9 ай бұрын
Love it, Paul!
@Excelmacromastery9 ай бұрын
Thanks Ben
@sasifexcelsolutions45098 ай бұрын
Hi, thanks for this, question, how would I force only xlsb when the user want to save as a file, I want the dialog picker or with 365 only show xlsb to show, this was possible before 365 but don't know how to do it in 365
@sudheerallamuri71329 ай бұрын
Thank you Sir.. I like your Vedios ❤❤
@mylife11319 ай бұрын
Harika video için teşekkür ederim Paul.
@Excelmacromastery9 ай бұрын
You're welcome
@richardgreves61619 ай бұрын
tried to download the code and I get Web server is returning an unknown error
@Info-God9 ай бұрын
Type it. This way you learn.
@kofigyebiadusei22058 ай бұрын
When will make an introductory video for us who are beginners. Thank you
@Excelmacromastery8 ай бұрын
Good suggestion.
@rajuhubli28 ай бұрын
Great video sir
@Excelmacromastery8 ай бұрын
Thanks
@JithinDevan9 ай бұрын
Thank you Paul - is there any way to speed up below requirement? I need to list all filenames from a folder and their last modified dates into a table. The folder has over 20,000 files and it’s taking ~5 mins to run the macro.
@sinus22209 ай бұрын
You can call Shell and run DIR command from there.
@Excelmacromastery9 ай бұрын
I think that would be fast. You can easily send to a file
@Back1Ply9 ай бұрын
Power query has from folder connector that lists files and last modified date
@JithinDevan9 ай бұрын
Thank you all for suggestions
@PIESvcs9 ай бұрын
When I see this, I'm reminded that the Data, Advanced Filter allows Unique data items to be filtered in place or copied to another location (using header rows, I think). I am wondering if this may be faster using the native Excel operability. One question I had (and benefit to using Paul's method) is if we want to know the number of occurrences for each Unique entry, an additional array may be useful, for example, if all of those monitors were to be assigned their serial numbers, assigned to users, maintained and depreciated. I needed to do this for network hardware in 1988 using QuickBASIC before VBA.
@sandeepkothari50009 ай бұрын
SURE, WE LIKE YOUR VIDEOS immensely & wany more
@Excelmacromastery9 ай бұрын
Thanks Sandeep
@sriranga1888 ай бұрын
Yes we need more videos
@Excelmacromastery8 ай бұрын
Thanks
@stevetatterton9 ай бұрын
Do you need to use LBound of the arrays when it will be 1 unless you specify otherwise, which you don't do here as it's not needed? Or is iterating from LBound to UBound seen as more elegant? I would find 1 easier to use as the For statement is then less cumbersome.
@Excelmacromastery9 ай бұрын
Using lbound is a defensive measure in case a zero based array used. But you'll get away using 1 in most cases.
@pupazzetti26809 ай бұрын
Yet you could make it even faster by using `Value2` (as you have previously taught in other videos). Just for curiosity, how much faster?
@Excelmacromastery9 ай бұрын
It would only make a difference if you had a large number of writes.
@mustavogaia26554 ай бұрын
This is poetry
@rahul7rock9 ай бұрын
Dictionary and Array is a deadly combination as always
@Excelmacromastery9 ай бұрын
Absolutely
@wizardofaus84739 ай бұрын
More videos like this please. Also, more videos not like this please. Basically, I would like more videos, as long as they are you teaching VBA. Thank you Paul
@Excelmacromastery9 ай бұрын
You're welcome.
@nivrin139 ай бұрын
How do you calculate the speed of the macro?
@Excelmacromastery9 ай бұрын
Using the Windows api timer
@Info-God9 ай бұрын
Define TStart and TEnd, then the difference is the TLapse
@mback37139 ай бұрын
Try using Collection instead of Dictionary. ;)
@Excelmacromastery9 ай бұрын
Why? They won't be faster.
@nivrin139 ай бұрын
Collection allows double entries, dictionary doesn't, so it's already filtering the data
@mback37139 ай бұрын
@nivrin13 um.... collection will error if you try to retrieve an element from it that is not in the collection. you use `on error resume next` then in your loop check the collection `_ = col[key]`, then switch to do something `if err.number then` and don't forget to `err.clear` after failing to retrieve a value. it works... a little hokey, but is faster than `if key in dict`
@mback37139 ай бұрын
@Excelmacromastery collection is "native" and doesn't require an import - and is more lightweight and faster than dictionary. It is a little "hokey" as you need to use error handling (the native "Err" object) to detect if a key/value pair exists in the collection, but... try it... sounds like you may be a little surprised at the result.
@nivrin139 ай бұрын
@@mback3713 Alright. I actually wanted to use the collection method in the past. This is a better approach. Will save it. Cheers!
@daves40268 ай бұрын
Bravo
@saketmishra14708 ай бұрын
Paul, please help me to make my code as faster you have shown here
@Charles-m7j9 ай бұрын
How to improve it further: use literally anything but VBA.
@junkertom77668 ай бұрын
Tell me you are a clueless VBA hater without telling that you are a clueless VBA hater.
@Charles-m7j8 ай бұрын
@@junkertom7766 it is literally ranked the worst programming language. Personally I don’t think that is fair because it isn’t a real programming language.
@markd.95388 ай бұрын
@@Charles-m7j Ranked... by who? Its a tool for a purpose. Yeah there's better languages out there; yeah its ugly; yeah it has poor object typing, and weak object security in parts... and yeah its not "fun" in the programming sense - but it has exceptionally good fit-for-purpose libraries when you have to crunch spreadsheets and data for insane business bosses who need to work in Office formats and need their little/big problem solved ASAP. Not everyone can be a L33t coder. Sometimes, spreadsheets pay the bills. VBA is ubiquitous - and exceptionally useful - in MANY environments.
@laurentbosc28968 ай бұрын
@@Charles-m7j ok and what else ? in the real World Vba is probably one of the most used. So this is a very simple view to tell that. And it should ont be taken alone but as one element of the Excel toolbox. With Power Query and power pivot, it gives powerful possibilities very easily, without any extra installation. This is why it is very used and so popular.
@laurentbosc28968 ай бұрын
And it is a programming language, literally speaking… not comparable to others ok, but it is powerful for other reasons as explained
@Hughahugha3619 ай бұрын
The code is nearly as fast as you deleting comments...