10 Years of VBA Array Knowledge in 40 Mins

  Рет қаралды 14,633

Excel Macro Mastery

Excel Macro Mastery

Күн бұрын

👉 Ready to Master VBA?
- Check out my course: bit.ly/3XTnIm8
- Subscribe to the channel here: bit.ly/36hpTCY
- Want to download the source code for this video? Go here: shorturl.at/nMnc6
(Note: If the download page doesn't work then make sure to turn off any popup blockers)
"10 Years of VBA Array Knowledge in 40 Mins"
Arrays are possibly the most important element of Excel VBA.
Not only do arrays make your code more readable, they also allow you to process data thousands of times faster than using Ranges. If you haven't used arrays before then you may be intimidated by them. But don't worry - In this video, I will distil years of VBA knowledge and experience into a set of simple steps that anyone can follow.
💻🔧 #VBAArray #VBAArrays #ExcelVBAArrays
Useful VBA Shortcut Keys
========================
Debugging:
Compile the code: Alt + D + L OR Alt + D + Enter
Run the code from the current sub: F5
Step into the code line by line: F8
Add a breakpoint to pause the code: F9 or click left margin
Windows:
View the Immediate Window: Ctrl + G
View the Watch Window: Alt + V + H
View the Properties Window: F4
Switch between Excel and the VBA Editor: Alt + F11
View the Project Explorer Window: Ctrl + R
Writing Code:
Search keyword under cursor: Ctrl + F3
Search the word last searched for: F3
Autocomplete word: Ctrl + Space
Get the definition of the item under the cursor: Shift + F2
Go to the last cursor position: Ctrl + Shift + F2
Get the current region on a worksheet: Ctrl + Shift + 8 or Ctrl + *
To move lines of code to the right(Indent): Tab
To move lines of code to the left(Outdent): Shift + Tab
Delete a Line: Ctrl + Y (note: this clears the clipboard)
Table of Contents:
00:00 - Introduction
00:22 - Why You Need Arrays
10:17 - How to Replace Ranges with Arrays
21:19 - Using Arrays in a real-world example
27:18 - Important - Avoid this major pitfall
31:59 - The code structure for all data manipulation
40:04 - How to easily sort any Array with this new method

Пікірлер: 84
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Learn how to write real-world Excel VBA code: 👉courses.excelmacromastery.com/ Let me know in the comments if you like this longer video format😀
@mariustapculescu1061
@mariustapculescu1061 27 күн бұрын
Yes is beautifull ,easy to follow you and learn a lot!
@sevencrickets9258
@sevencrickets9258 27 күн бұрын
I have been utilizing your resources for 5+ years. I'm a stress engineer, so sifting through tons of raw data and outputting something useful with little individual input is the name of the game. Your stuff has been without question my favorite resource. Clear. Concise. Exactly what is needed.
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Glad you like it so much😀
@SolutionsByPVV
@SolutionsByPVV 27 күн бұрын
Paul, your tutorials are fundamental. Yes, I like them.
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Thanks
@hammeedabdo.82
@hammeedabdo.82 27 күн бұрын
thanks Mr. Pau. Please, we need more videos with projects about real-time application in excel through websockt.
@vbaclasses3553
@vbaclasses3553 27 күн бұрын
Amazing video as always Paul. The longer format is quite good as well. Thanks.
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
Thanks
@billroberts2808
@billroberts2808 27 күн бұрын
Thanks Paul - as always your videos contain very useful information. I like the longer content video above. It provides a more 'start to finish' approach to code logic. Best regards, Bill
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Thanks Bill
@nathanbowers1761
@nathanbowers1761 27 күн бұрын
Hi Paul, I appreciated that longer video format. It helped me locate where I'm at in my Excel VBA Array journey, and the clear explanations helped me to move to the next level. Nice tutorial; I'm a fan of your work!
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
Great to hear Nathan!
@JOSELUISTORREZRIOS
@JOSELUISTORREZRIOS 26 күн бұрын
Excelente tutorial paso a paso y muy útil, muchas gracias
@kcerny43
@kcerny43 22 күн бұрын
It's a pure pleasure to work with your tutorials.
@Excelmacromastery
@Excelmacromastery 20 күн бұрын
Thanks
@VBA-w7q
@VBA-w7q 16 күн бұрын
Excellent, as always! Best cristal clear VBA tutorials ever! I've learned a lot form you! Thank you for that! Please, share us more of your knowledge! AI can automate tasks, but human makes them personalized. So, for Excel dependent jobs, VBA can help a lot if deeply understood and learned.
@Excelmacromastery
@Excelmacromastery 14 күн бұрын
Thank you
@muhammadkausar2842
@muhammadkausar2842 24 күн бұрын
Hi Paul, you are amazing, i also download your ClsArray2D class module, and take so much benefits, thank you, now am also able to make my own function for arrays current region, or clear existing data,,. I also download this one , thank you so much for your free help😊
@vipulDJhaveri
@vipulDJhaveri 26 күн бұрын
Thanks Mr. Paul Great way to master , step by step - so basic fundamentals are very clear as we move forward with clutter free powerful codes - Your Mastery, always shared brilliantly to make us Masters as well ! Thanks a Lot for sharing your treasure 🙏
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
Glad it was helpful!
@stevetatterton
@stevetatterton 13 күн бұрын
I would suggest the GetCurrentRegion function should call another function to remove heading lines but setting the current region property outside of calling that function. Then the inner function can be used to remove headings from any region even if current region isn't to be applied.
@danielmelo389
@danielmelo389 27 күн бұрын
Nice video, I'm working more with VBA nowadays and the knowledge I got from you helped me a lot, though I haven't adapted to not bubble up my variable declarations yet 😅
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Thanks Daniel
@sedataksakal414
@sedataksakal414 25 күн бұрын
You are amazing. Thank you. Greetings from Turkey.
@Excelmacromastery
@Excelmacromastery 23 күн бұрын
Thanks
@nadermounir8228
@nadermounir8228 22 күн бұрын
Thank you paul for this nice video. I am already taken your VBA effective course
@Excelmacromastery
@Excelmacromastery 21 күн бұрын
You're welcome
@emililie2244
@emililie2244 23 күн бұрын
Thank you. I learned a lot.
@121960864
@121960864 16 күн бұрын
Thank you very much! It helps me so much!😀
@Excelmacromastery
@Excelmacromastery 14 күн бұрын
You're welcome
@dangreen2501
@dangreen2501 27 күн бұрын
I like anything you do!
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Thanks 😊
@alterchannel2501
@alterchannel2501 26 күн бұрын
i adore these types of videos
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
Glad you like them
@simioneitor1975
@simioneitor1975 19 күн бұрын
Amazing! Thank you!
@Excelmacromastery
@Excelmacromastery 14 күн бұрын
You're welcome.
@kofigyebiadusei2205
@kofigyebiadusei2205 27 күн бұрын
Hello Paul. I'm Kofi from Ghana. Please when will you make a VBA introductory video. It will be very much appreciated. Thank you
@peterwooldridge7285
@peterwooldridge7285 9 күн бұрын
Just the best!!!
@muhammadkausar2842
@muhammadkausar2842 24 күн бұрын
Really amazing work, yes we like it. I watched it 2 times 😂
@Excelmacromastery
@Excelmacromastery 23 күн бұрын
You're very welcome
@iincitr
@iincitr 26 күн бұрын
Thank you again clean and valuable info. Any plan to video about Excel with Typescript or any other modern code?
@Excelmacromastery
@Excelmacromastery 25 күн бұрын
I have videos on office scripts and Python on this channel.
@m_marcamo
@m_marcamo 27 күн бұрын
Thanks for your knowling
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
You're welcome
@dheerajjain5754
@dheerajjain5754 25 күн бұрын
Can we use arrays to copy all file names from a folder and paste it in an excel range? I am currently using "Copy Path" menu item to copy all file names which are there in a folder and pasting them in excel because it is simpler and time saving than running a macro which reads each file one by one and copies its name.
@daveyks1
@daveyks1 27 күн бұрын
Love this video! Do you program in Access VBA? Please would you do one for Access if you do? Thanks!
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Glad you like it. I haven't used Access in a long time .
@Art8157
@Art8157 26 күн бұрын
Paul, thanks for nice and detail comments. I have one question, why when I use "marks = shMarks.range("A1").Value" I receive error 424 (Object required). And it works when I write "marks = Sheets("shMarks").range("A1").Value".
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
shMarks should be the code name of the worksheet
@alexandrumarcel3696
@alexandrumarcel3696 26 күн бұрын
one issue I was facing when working with copying arrays is that if you have a column (or more) that is containing string values that starts with "0", the destination range needs to be formatted as text (.numberformat = "@"), otherwise the leading 0s will be truncated.
@johnbutler2750
@johnbutler2750 19 күн бұрын
If your numbers are of fixed length you can always just add zeros to the front and take the right of the required length, then number value of that Always a pain on bank details and phone numbers Tho it’s more annoying working with sort codes as some of the time it converts 6 digits separated by hyphens to dates
@alexandrumarcel3696
@alexandrumarcel3696 18 күн бұрын
@@johnbutler2750 your solution for a simple copy paste will add a lot of extra effort to implement, especially if you have more columns that are not always being pasted into the same cells
@johnbutler2750
@johnbutler2750 18 күн бұрын
@@alexandrumarcel3696 meant it as a more general solution, either use a custom function to apply it when called in a larger macro, or as a nested formula to apply to an entire column then copy-paste as values (depending on how often it’s used)
@ManojYadav-nt2rm
@ManojYadav-nt2rm 11 күн бұрын
how much time it will take if the data is 10k plus?
@urielramirez27
@urielramirez27 25 күн бұрын
Simply masterful! Do you have any courses or classes in recursive functions?
@Excelmacromastery
@Excelmacromastery 25 күн бұрын
Thanks. I haven't covered recursion.
@urielramirez27
@urielramirez27 24 күн бұрын
@@Excelmacromastery if you need an example idea for the course I have 2: getting the names of files in folders that have subfolders and getting the charges on a credit card charges history that sum up to the credit card current balance
@schymi841
@schymi841 27 күн бұрын
Nice video but I have a feeling that you've covered this topic multiple times already in previous videos. As a long time fan of your content I consider myselft a master on arrays at this point :) I'd prefer more videos on Classes with some real world examples....
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Thanks. I have covered a lot of this before. However, this video shows a step by step logic from beginning to end.
@trevormckerrow1460
@trevormckerrow1460 13 күн бұрын
As always your tutorial was very informative. One issue; I get a runtime error when calling the worksheet sort function. This function seems to be unavailable in my workbook. Do you know why?
@Excelmacromastery
@Excelmacromastery 13 күн бұрын
It's only available for Excel 2021 and 365
@omaraissa318
@omaraissa318 27 күн бұрын
i didn't watch the video but i have a trick about array i don't know if you are aware of. its how to redim preserve an array's first dimension, we know that we can only redim the second dimenssion , so the trick is to fill your Array in reverse order what in first dimension go into the second and what in the second go into first dimension, so then you redim preserve the second dimension after that you transpost the array into a variant using worksheetfunction.transpose to get your initial copied range.
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
The problem is that Transpose has a limit of 64000 rows for arrays.
@omaraissa318
@omaraissa318 26 күн бұрын
@@Excelmacromastery thank you i learned something
@muhammadkausar2842
@muhammadkausar2842 24 күн бұрын
​@@omaraissa318I have also the same problem, I use meta AI, but AI say, Copy this Array to new blank array and then resize it 😂 Thank u But still I am not completely understand of your comment I will screenshot it 😊
@howitworks8749
@howitworks8749 27 күн бұрын
Thanks for sharing valuable information. I am already using array but it is still taking time to process big datasets. I have checked the number of iterations is more than 30+ million. Please can you tell me is there any way through which I can use GPU or multi-thread? I have done a lot of research regarding this and someone told me to use opencl but unable to find the library. I have tried to find some third-party tools also for parallel processing but I haven't found any tool yet. Please can you help me that would be great.
@suvadipkundu152
@suvadipkundu152 26 күн бұрын
Hi, would you like to elaborate on the problem statement a bit.. for example, would 30 million iterations mean that you are accessing data from multiple spreadsheets? What type of validations/logic are you processing? Can you employ 'divide and conquer' approach? Finally, have you looked at using Excel's ETL backbone, power query as a solution? I do not know the performance criteria you have so if you can throw some more light on the same that will help .. Cheers, Suvadip
@johnbutler2750
@johnbutler2750 19 күн бұрын
I don’t think vba is the best tool for massive datasets. From my experience once you’ve done the usual disabling calculations, events and screen updating and are doing most of the work in arrays thats about as fast as you’ll get (advanced filter can be faster for large filtering operations). I believe vba is single threaded (worksheet formulas can use more) this can make large parallel operations slow I also doubt it takes advantage of the gpu much if at all. I think python may the better tool to use for large data analysis
@alializadeh8195
@alializadeh8195 26 күн бұрын
Thanx
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
Welcome
@Dexter101x
@Dexter101x 24 күн бұрын
I don't mind the longer format, but would like shorter ones as well Is there something wrong with using xlDown as oppose to xlUp?
@Excelmacromastery
@Excelmacromastery 23 күн бұрын
It will stop at a blank row if searching from the top.
@home8771
@home8771 26 күн бұрын
does anyone know how to do "make a multiple line as comment" shortcut like the one in 14:35?
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
See the second answer here: shorturl.at/HaQN1
@Zboob999
@Zboob999 27 күн бұрын
Nice. What about Typescript for Excel ?
@Excelmacromastery
@Excelmacromastery 26 күн бұрын
I have some videos on Office Scripts which using the TypeScript language for Excel.
@daneasch9703
@daneasch9703 9 күн бұрын
Hi Paul, Realy enjoyed the webinar, Thanks. I did run in a problem with the code, trying to filter I get the eror " unable to get the sort property of the worksheetfunction class" on line "outputArray = WorksheetFunction.Sort(outputArray, 4, -1)" . any ideas?
@Excelmacromastery
@Excelmacromastery 5 күн бұрын
You need Excel 2019 or later to use the sort function.
@daneasch9703
@daneasch9703 4 күн бұрын
@@Excelmacromastery Thanks Paul, that explains it. Nice webinar, again. Like the lenght.
@user-nj6em3lf9o
@user-nj6em3lf9o 25 күн бұрын
Hi Mr KELLY. Hope you're fine. I guess you've heard about Office script. My concern is to know if VBA is will still be used in the 5 or 10 next years?!!! Is Office Script is replacement!! I've got those worries since I read somewhere that Microsoft will definetively discard VBScript from Windows 11. Do you have clear and trustfull informations about that topic?
@Excelmacromastery
@Excelmacromastery 25 күн бұрын
Office scripts is not a replacement for VBA. The VBScript update, as it stands now, will only affect regular expressions in VBA.
@Fredick.7
@Fredick.7 27 күн бұрын
🙂_______👍💯 .
@Excelmacromastery
@Excelmacromastery 27 күн бұрын
Thanks
Watch these 28 minutes if you want to become an Advanced VBA user...
29:01
Excel Macro Mastery
Рет қаралды 50 М.
How To Master Arrays In Excel VBA + FREE MACROS & CHEAT SHEET
29:09
Excel For Freelancers
Рет қаралды 6 М.
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
5 HIDDEN Excel Tools Almost Nobody Is Talking About
9:00
MyOnlineTrainingHub
Рет қаралды 39 М.
How to Use a SQL Function in ANY Excel Workbook! (No Outside Installation Required)
18:21
How to Design and Code an Excel VBA Application Like a Pro
42:27
Excel Macro Mastery
Рет қаралды 212 М.
Class Modules in VBA: Made Super Simple
17:43
Excel Macro Mastery
Рет қаралды 30 М.
10 Excel Formulas That Will Set You Apart (Cheat Sheet)
18:04
MyOnlineTrainingHub
Рет қаралды 222 М.
The Ultimate Guide to Copying Data using Excel VBA
31:05
Excel Macro Mastery
Рет қаралды 63 М.
Writing My Own Database From Scratch
42:00
Tony Saro
Рет қаралды 184 М.
Enums(Enumeration): The Key to Cleaner, More Efficient VBA Code
9:58
Excel Macro Mastery
Рет қаралды 29 М.
Say Goodbye to IF Statements in Excel with SWITCH
7:45
Teacher's Tech
Рет қаралды 464 М.
Как бесплатно замутить iphone 15 pro max
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 60 М.
Cheapest gaming phone? 🤭 #miniphone #smartphone #iphone #fy
0:19
Pockify™
Рет қаралды 4,2 МЛН
ГОСЗАКУПОЧНЫЙ ПК за 10 тысяч рублей
36:28
Ремонтяш
Рет қаралды 509 М.
Samsung Galaxy 🔥 #shorts  #trending #youtubeshorts  #shortvideo ujjawal4u
0:10
Ujjawal4u. 120k Views . 4 hours ago
Рет қаралды 8 МЛН