This is exactly what I am looking for. I work in telecom industry. It took me hours to process raw data.. now .. down to less than 20 mins with a humble system. Thank you .. where have you been 10 years ago ? I can't thank you enough .
Absolutely fabulous instruction. Seeing the array filled with one line of code and then watching it crunch 2500 records in a blink, was the most fun I've had in a while... sad, but still fun! Thank you Paul.
I like the format of your videos and the way you explain things. Even if I know some of them, I still watch just because you're one of the very few on youtube that is actually enjoyable to listen to.
I am self-taught and I didn't fully grasp this content the first couple of times I looked at it. I decided I needed to better understand it and it now makes sense.
Magnificent.... I have very complex range operations which take my program 281 seconds to perform. With this method I reduced the time to under 5%.... Best ever YT content I've encountered. Keep doing, don't stop. Ever! It has the potential to be great...
Has to be the best vba tutorial I've seen on UA-cam. Lots of garbage stuff out there. I'm a self taught VBA user, picked up a few very helpful codes and ideas watching this. Thank you
Amazing!! I watched tons of vba videos (I'm newbie) and by far this video gives a incredible edge because of its clear and concise information. Excellent!! Great work, please keep it up!!
From someone putzing around with VBA for a few years, finding R Studio was a godsend. Perhaps there are special instances where you might have to use Excel, but I'd advise anyone who thinks they should spend time learning to code VBA to give R a try.
I stumbled upon something quite interesting when playing around with this. If you try to set an array, it will return the properties of each cell in a range instead of the value of the cells in the range. Very useful to get a number of properties information
Excellent video.I can see the value of arrays, as opposed to ranges, and am in the process of changing one of my user forms.However, what the video does not cover and I am interested in is the following:Placing the data from the user form back into the table/spreadsheet.
Amazing tutoring as always! Keep these videos coming!! They're making a world of a difference to my (currently limited) VBA skills. I had a thought, would you consider doing a video on how to use VBA generically? Like copy+paste files across different folders, or using VBA to send a standard email message? Not pushing for this but thought it could be interesting. Thanks!!
Thaks!!! Have just changed the code in one of my macros to use arrays. I go through 200k lines in a table. Before, it took 3m20s, now it finishes in 12s, 16x faster!
Good stuff.... taking baby steps with my VBA project but every step is in the right direction with these videos!!... (oh and of course I have liked this video!)..
mahdi zahzah je vous applaudis d’avoir pris le temps pour comprendre ce qui n’est évidement pas facile à apprendre surtout en une autre langue. Continuez de faire de votre mieux et je vous assure que vous réussirez!
Excellent video! Just one suggestion: try to make sporadically zooming into the VBA code to facilitate the viewing on smartphones. The fixed view you are using is perfect for computer screens, but hard to see in small devices
this is on fire guys...the arrays functions can makes us our projects much easier and fastest....i am also trying to learning this arrays functions codings,....can someone pls explain me why the sir has used i,1 and i,5 in 6:43 minutes i want to use count of columns so what would be just basic formula for counting columns in arrays.
I'm far from a newb with VBA and I'm still learning some things I didn't know from your vids, thanks! Question : I see you use .value I have always been told to use value2 because it is allegedly faster and gives the underlying value...thoughts?
I use Value for almost everything and I never have a problem. There may be specific cases where you need it: "The only difference between this property and the Value property is that the Value2 property doesn't use the Currency and Date data types." -docs.microsoft.com/en-us/office/vba/api/excel.range.value2
Value2 seems to be faster (for all types) and safer (for currencies and dates): fastexcel.wordpress.com/2011/11/30/text-vs-value-vs-value2-slow-text-and-how-to-avoid-it/ I recreated the analysis in that blog with similar favorable metrics for Value2 over Value.
Sir, Thanks for uploading such nice videos on very basic yet foundation to onward VBA coding. Sir, unfortunately when I run codes, error message pop out. The error message contain a "Run-time error 13 Type Mismatch". Please advice me on correct the error. Lots of love to your continued efforts. Keep going, Sir.
Great video as usual. Quick one. I've been coding VBA for approx 5 years and consider myself a moderate to advanced user. One thing I encounter when setting ranges and pasting arrays back it pastes values and I loose formulas. Is there a method of inputting formulas into the array when it is pasting back out?
Thanks, very informative. I have a question though: How do I manage to format my cells to achieve a good layout? My current Excel sheet is rather slow as I copy a row and insert it, but with this (slow) technique I don't have to care about number/text/date/currency formats or cell formats (yellow background, bold numbers) etc. as Excel takes care of that for me. Should I work with arrays and after my "tables" are filled with data, another macro formats the cells according to my wishes? Or is there another approach?
I "tweaked" my Excel spreadsheet and was able to speed up the operations by a factor of 17 (of course, I did not use 'select' and similar bad techniques from the start). I did this by using arrays and, instead of adding one row per operation, added all the needed rows at once and inserted the array contents into those empty with one go. The format of the cells (styles, number formats, borders...) is fixed at the end for the entire "table". Thanks :)
Hey Paul, amazing Tutorials of yours!! Will this code also adapt to added rows within oder at the end of the original table, as it does with added rows?🙏😎🇩🇪
First of all. Thank you for taking VBA to a whole new level! These videos are great. I got stuck at the code at 3:14 . VBA says gives a compile error: "Variable Not Found" for "shData". Any idea why it is working for you but not mine? VBA version is 7.1.
This is a minor thing: My attempt to transfer range logic to array logic failed, because I used "for each"-loops to access the cells in the range. This is not working. So I just have to rebuild my code around two dim array logic. The speed gain is still unbelievable, and I am more than grateful for this contribution. Originally I thought that for each logic should work as in the following code e seems to be a reference to the range/cell element: for each e in myRange e.value="Changed" next e. This would result in a cell value of "Changed" throughout the whole range. Any suggestion, how to transfer that?
Loving your videos. A lot of my data is in word documents and I want to use VBA to move it to excel. Is there a similar way to copy a word table into an array without looping through all cells or using a copy/paste command?
This is really really great and has reduce the processing speed of my code dramatically. The only issue that I have encountered is writing the data back to the same location (I am pulling the data from an Excel table) that is filtered. I see very strange results where the first row of the array is inserted into the last line that is displayed. Any suggestions on how to paste back to a range / table that is filtered? I could remove the filter and then re-apply it, but if that data that is changed in the array, then the same filter would not be applied.
Thank you Paul! I was wondering if it is possible to get other cell attributes (like cell background color) and not only cell value into an array ( without iterating through the entire range)? I have a very large range which I need to get the background colors of each cell, and it takea very long to run...
Paul, that's really excellent. I have used arrays like this before but your code is so short. I didn't know you could write the data by saying "= arr". I will use that a lot from now on. In your demonstration, the Amount values written to column L are not the same as read from column E. Is there some data type issue here do you know? Thanks
Thank you Paul for sharing great stuff about VBA. I am avid reader of your website content excelmastery. can you please write a or share stuff about excel vba with access connectvity
Thanks for your Awesome Video Sir. We are selecting the around 5 columns in array and copy, pasting it to different columns arr with same 5 columns. But I have different scenario. So my question is can I select 5 columns in array, copy, paste only any 3 column Eg. Column A, B, E.. Only by using array. Please help me Or Give me alternate idea
Thanks for the video on Arrays. The application i am build relies heavily on arrays and this is simply explained and very helpful for a Novice VBA user! Somewhere else I learned that you should release your variables after the end of the Sub. e.g.: "Set arr = Nothing" Is this true?
A million thank you, could you please suggest if we substarct same value what you have mention but I want to add column in the end and calculation value mention . Can we do that?
Hello. Wonderful lecture! Thanks. My question: is there a way by which I store my database table in an array when my workbook opens AND use/call the array at different times wherever required??
Hi Paul.. excellent.. as always. Your lessons are really great.. quick and to the point.. clear and easy to follow.. full of valuable tips, tricks and insights. Even when the topic is something I know or think I know, I learn something new from watching you work. Thanks for all the videos, web site, webinars, etc. Super helpful and informative. Very much appreciated. Thumbs up! PS - Any chance that you might provide a link to your video example workbooks to follow along with the lessons? Usually, I dummy up my own data.. but would be nice to be able to do a quick download and work on the same data and produce the same results as in the tutorial. Just a suggestion :-)) Thanks again
Wow, thank you for such an awesome tutorial! I also like your coding style (similar to mine) which is a lot easier to read - in my humble opinion. I can cope with most people's code that does not use LNC (Leszynski Naming Convention) but not indenting the code is purely lazy and inconsiderate!
Learn how to write real-world Excel VBA code: 👉courses.excelmacromastery.com/
Best vba channel i ever found !
X2
Dear Kelly Thank you and I want to learn more about Excel VBA
This is exactly what I am looking for. I work in telecom industry. It took me hours to process raw data.. now .. down to less than 20 mins with a humble system. Thank you .. where have you been 10 years ago ? I can't thank you enough .
The information you give us is so clean, easy-to-understand and implement… I just love your channel, Im hoping to buy the handbook soon
Thanks Gonza
Absolutely fabulous instruction. Seeing the array filled with one line of code and then watching it crunch 2500 records in a blink, was the most fun I've had in a while... sad, but still fun! Thank you Paul.
Glad you liked it Michael.
I like the format of your videos and the way you explain things. Even if I know some of them, I still watch just because you're one of the very few on youtube that is actually enjoyable to listen to.
Thanks
I am self-taught and I didn't fully grasp this content the first couple of times I looked at it. I decided I needed to better understand it and it now makes sense.
Thank you Paul for all your content!!!
Dictionaries, arrays, collections and classes are the best.
Magnificent.... I have very complex range operations which take my program 281 seconds to perform. With this method I reduced the time to under 5%.... Best ever YT content I've encountered. Keep doing, don't stop. Ever! It has the potential to be great...
Has to be the best vba tutorial I've seen on UA-cam. Lots of garbage stuff out there. I'm a self taught VBA user, picked up a few very helpful codes and ideas watching this. Thank you
Glad you liked it.
Where have you been all my life? This is awesome!
Amazing!! I watched tons of vba videos (I'm newbie) and by far this video gives a incredible edge because of its clear and concise information. Excellent!! Great work, please keep it up!!
Incredible how efficient you codes are, yet explain it so simple. Genius!
From someone putzing around with VBA for a few years, finding R Studio was a godsend. Perhaps there are special instances where you might have to use Excel, but I'd advise anyone who thinks they should spend time learning to code VBA to give R a try.
Absolutely a clear and concise explanation of using arrays. Well done! You gained another subscriber.
This video got me up a high wall...by making my code cut thru a dead end(error) and in a fast way...Genius!
Great job Paul. Love using arrays now. So much more efficient.
Best Video on the Interweb , Internet & Galaxy !! Star Paul !! Your an Amazing Star !!
I have done some of this before, but not the resize aspect. Great tips, thanks Paul.
I stumbled upon something quite interesting when playing around with this. If you try to set an array, it will return the properties of each cell in a range instead of the value of the cells in the range. Very useful to get a number of properties information
If you use Set with a variant to a range it will return the range rather than the array.
Excellent video.I can see the value of arrays, as opposed to ranges, and am in the process of changing one of my user forms.However, what the video does not cover and I am interested in is the following:Placing the data from the user form back into the table/spreadsheet.
Great VBA teacher, I've tried various different tutorials and keep coming back here!
Thanks for your support my videos Andrew
Amazing tutoring as always! Keep these videos coming!! They're making a world of a difference to my (currently limited) VBA skills.
I had a thought, would you consider doing a video on how to use VBA generically? Like copy+paste files across different folders, or using VBA to send a standard email message? Not pushing for this but thought it could be interesting. Thanks!!
Really awsem, never seen such effective and shorter code in my life, again thanks for creating this video, love you, really helped me a lot
You're welcome!
Thaks!!! Have just changed the code in one of my macros to use arrays. I go through 200k lines in a table. Before, it took 3m20s, now it finishes in 12s, 16x faster!
That's great to hear.
Thanks a lot! A very clear explanation that addressed exactly what I was looking for. You're a great teacher!
Wow...i now really appreciate arrays. Very efficient compared to ranges. Thanks Paul
as always all your videos are amaizing and greats!
Good stuff.... taking baby steps with my VBA project but every step is in the right direction with these videos!!... (oh and of course I have liked this video!)..
Mille merci Mr
Malgré que je suis très faible en anglais mais j'essaye le maximum de vous suivre car je sais bien que votre vidéo est très utile
mahdi zahzah je vous applaudis d’avoir pris le temps pour comprendre ce qui n’est évidement pas facile à apprendre surtout en une autre langue. Continuez de faire de votre mieux et je vous assure que vous réussirez!
Clear and concise, I love it!!!
Why does this have only 69k views? It should be on the top of the recommendations on UA-cam!
Thank you so much for the very useful tips using arrays in vba!! :)
Absolutely loved this tutorial! Thank you sir!
20 Minutes to 33 seconds!!! Thank you very much.
Mr Kelly, you are a champion 🏆 😎👍
Thanks Man! you and Leila are the best in excel tips!
Awesome paul.... U r the master of vba... Great to have u as a teacher
Glad you like it.
Another really 1st class video, really simple and robust code that covers so many practical situations
Great stuff Paul, big fan From Florida USA....
Amazing teacher, each video I watch I learn a new trick. Thanks a lot
Thanks for your comment George
Great work Sir, you real world examples are so fascinating. I have a question to in the same situation.
From Algeria, thank you Paul for this vidéo.
This is a fascinating topic. I think I can adapt this to copying non-contiguous ranges from one workbook to another, but I'm not quite sure.
You can @ Eduardo Chavarria
Excellent video! Just one suggestion: try to make sporadically zooming into the VBA code to facilitate the viewing on smartphones. The fixed view you are using is perfect for computer screens, but hard to see in small devices
agree!
Many thanks, excellent and well explained, it is crystal clear, your video helped me a lot.
Glad you liked it Adam.
Thank you so much. Great video. I am learning a lot. Very useful tips.
You're a beast. Your content is the best.
BEST VBA ADVICE EVER!!!! Wow, you are awesome :-)
Glad you think so!
Very nice explanation..... keep it up ....
Awesome work!
This guy is a frickin' genius.
Really awesome! Never seen such effective and shorter code in my life, again thanks for creating this video, love you, really helped me a lot!!
Thankyou so much for this tutorial, really helped me a lot! and saved my time.. thanks a lot yet again!! :))
Thank you. Great video.
this is on fire guys...the arrays functions can makes us our projects much easier and fastest....i am also trying to learning this arrays functions codings,....can someone pls explain me why the sir has used i,1 and i,5 in 6:43 minutes
i want to use count of columns so what would be just basic formula for counting columns in arrays.
I'm far from a newb with VBA and I'm still learning some things I didn't know from your vids, thanks! Question : I see you use .value I have always been told to use value2 because it is allegedly faster and gives the underlying value...thoughts?
I use Value for almost everything and I never have a problem. There may be specific cases where you need it:
"The only difference between this property and the Value property is that the Value2 property doesn't use the Currency and Date data types." -docs.microsoft.com/en-us/office/vba/api/excel.range.value2
Value2 seems to be faster (for all types) and safer (for currencies and dates):
fastexcel.wordpress.com/2011/11/30/text-vs-value-vs-value2-slow-text-and-how-to-avoid-it/
I recreated the analysis in that blog with similar favorable metrics for Value2 over Value.
@@dougdevine27 Thanks, good link...I'll stick to using value2...but I'm sure for most real world cases it makes little difference
amazing video, thanks, you are my best vba mastery legend.
Wow, thanks
Always loved watching your videos.
Just a quick question.
How can I adjust this to lets say I want Columns A, C to E.
Sir, Thanks for uploading such nice videos on very basic yet foundation to onward VBA coding. Sir, unfortunately when I run codes, error message pop out. The error message contain a "Run-time error 13 Type Mismatch". Please advice me on correct the error. Lots of love to your continued efforts. Keep going, Sir.
Great video as usual. Quick one. I've been coding VBA for approx 5 years and consider myself a moderate to advanced user. One thing I encounter when setting ranges and pasting arrays back it pastes values and I loose formulas. Is there a method of inputting formulas into the array when it is pasting back out?
you are a G.O.A.T. probably also take us through append
Thanks for uploading this Paul.
Great video !! Thanks for sharing with us !
Paul this is awesome. Can this be used in Class Module. if not please show us how to do it. Thanks in advance.
Thank you Paul a brilliant video again,
Thank you so much! This is great.
Thanks, very informative. I have a question though: How do I manage to format my cells to achieve a good layout? My current Excel sheet is rather slow as I copy a row and insert it, but with this (slow) technique I don't have to care about number/text/date/currency formats or cell formats (yellow background, bold numbers) etc. as Excel takes care of that for me. Should I work with arrays and after my "tables" are filled with data, another macro formats the cells according to my wishes? Or is there another approach?
I "tweaked" my Excel spreadsheet and was able to speed up the operations by a factor of 17 (of course, I did not use 'select' and similar bad techniques from the start). I did this by using arrays and, instead of adding one row per operation, added all the needed rows at once and inserted the array contents into those empty with one go. The format of the cells (styles, number formats, borders...) is fixed at the end for the entire "table". Thanks :)
Awesome! Can we access to the cell properties and methods within the array?
A query, in an array (not in excel cells) is it possible to include background color? or put background color to certain elements of that array?
Mindblowing 💯💯
You sir, are next level. AMAZING!!!
Amazing explanation! Congrats!
Thank you for the video :) It was helpful for me.
Glad it helped!
Hey Paul, amazing Tutorials of yours!! Will this code also adapt to added rows within oder at the end of the original table, as it does with added rows?🙏😎🇩🇪
First of all. Thank you for taking VBA to a whole new level! These videos are great. I got stuck at the code at 3:14 . VBA says gives a compile error: "Variable Not Found" for "shData". Any idea why it is working for you but not mine? VBA version is 7.1.
I figured it you. Looks like you are referencing the sheet name under Microsoft excel objects.
This is a minor thing: My attempt to transfer range logic to array logic failed, because I used "for each"-loops to access the cells in the range. This is not working. So I just have to rebuild my code around two dim array logic. The speed gain is still unbelievable, and I am more than grateful for this contribution. Originally I thought that for each logic should work as in the following code e seems to be a reference to the range/cell element: for each e in myRange e.value="Changed" next e. This would result in a cell value of "Changed" throughout the whole range. Any suggestion, how to transfer that?
Learning a lot. Thanks!!
Great tips, thanks!
Loving your videos. A lot of my data is in word documents and I want to use VBA to move it to excel. Is there a similar way to copy a word table into an array without looping through all cells or using a copy/paste command?
Awesome content. Keep sharing useful tips and tricks.
It is much helpful for developers life. :) :)
Always great stuff, very well presented
Thanks Gary
Thanks a lot, this is awesome.
This is really really great and has reduce the processing speed of my code dramatically. The only issue that I have encountered is writing the data back to the same location (I am pulling the data from an Excel table) that is filtered. I see very strange results where the first row of the array is inserted into the last line that is displayed. Any suggestions on how to paste back to a range / table that is filtered? I could remove the filter and then re-apply it, but if that data that is changed in the array, then the same filter would not be applied.
Thank you Paul! I was wondering if it is possible to get other cell attributes (like cell background color) and not only cell value into an array ( without iterating through the entire range)? I have a very large range which I need to get the background colors of each cell, and it takea very long to run...
thank you very much!
Paul, that's really excellent. I have used arrays like this before but your code is so short. I didn't know you could write the data by saying "= arr". I will use that a lot from now on.
In your demonstration, the Amount values written to column L are not the same as read from column E. Is there some data type issue here do you know?
Thanks
Thank you Paul for sharing great stuff about VBA. I am avid reader of your website content excelmastery. can you please write a or share stuff about excel vba with access connectvity
Thanks for your Awesome Video Sir. We are selecting the around 5 columns in array and copy, pasting it to different columns arr with same 5 columns. But I have different scenario. So my question is can I select 5 columns in array, copy, paste only any 3 column Eg. Column A, B, E.. Only by using array. Please help me Or Give me alternate idea
Thank you for what you have taught, see if it is possible with an array to load a listbox with more faith than 10 columns faster??? greetings
Thanks for the video on Arrays. The application i am build relies heavily on arrays and this is simply explained and very helpful for a Novice VBA user!
Somewhere else I learned that you should release your variables after the end of the Sub. e.g.: "Set arr = Nothing" Is this true?
You only use Set for objects like Collections, Ranges etc. You don't use it for arrays. In general it is good practice.
@@Excelmacromastery ~ That explains it, thanks!
Excellent
Could you do a video tutorial on how to create a chart using arrays in VBA? I’ve been struggling and not sure what to do
A million thank you, could you please suggest if we substarct same value what you have mention but I want to add column in the end and calculation value mention . Can we do that?
Hello. Wonderful lecture! Thanks.
My question: is there a way by which I store my database table in an array when my workbook opens AND use/call the array at different times wherever required??
Hi Paul.. excellent.. as always. Your lessons are really great.. quick and to the point.. clear and easy to follow.. full of valuable tips, tricks and insights. Even when the topic is something I know or think I know, I learn something new from watching you work. Thanks for all the videos, web site, webinars, etc. Super helpful and informative. Very much appreciated. Thumbs up!
PS - Any chance that you might provide a link to your video example workbooks to follow along with the lessons? Usually, I dummy up my own data.. but would be nice to be able to do a quick download and work on the same data and produce the same results as in the tutorial. Just a suggestion :-)) Thanks again
Thanks Wayne. I might include the data in some of the videos in the future.
Fatastic video. Thanks
06:49 - Was Wow--- In one line we can paste the range that we work on
Wow, thank you for such an awesome tutorial!
I also like your coding style (similar to mine) which is a lot easier to read - in my humble opinion. I can cope with most people's code that does not use LNC (Leszynski Naming Convention) but not indenting the code is purely lazy and inconsiderate!
Excellent video.!!!!!!!!!!!!!
Thank you very much!