Create an Excel VBA Application Like a Pro

  Рет қаралды 39,452

Excel Macro Mastery

Excel Macro Mastery

Күн бұрын

Пікірлер: 59
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
I hope you enjoy this video. You can download the source code from the video description.
@nicholasniedzielski4707
@nicholasniedzielski4707 4 жыл бұрын
this is from a question i asked you a few week back, honored to have the video
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
What problem are you having?
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
You're welcome Nick.
@tangsh497
@tangsh497 3 жыл бұрын
you are the Best VBA master i v seen
@jlmcconchie
@jlmcconchie 3 жыл бұрын
This is simply the most valuable video I have ever seen for “amateur” Programmers. The lessons it teaches about how to organize the construction of a program are invaluable and I suspect it will be the rare programmer who will be be efficient and timely without using the methodology used here. Thanks!
@anxonpues6018
@anxonpues6018 2 жыл бұрын
I had sawn this file maybe 6 or 7 times, one reason is that my language is spanish and you speak clear but sometimes faster than I can listen on time, but the stronger reason to review this LECTURE is that I will put it as the best exposition on the subject to write not vba for excel it's the BEST EXPOSITION ON HOW TO WRITE SOFTWARE. With all my respect to a good teacher CONGRATULATIONS.
@jimfitch
@jimfitch 4 жыл бұрын
Wow! Thank you, Paul. I have some very large applications with lots of interaction with different worksheets, & I often redesign the worksheets to add functionality, improve display, etc. I have struggled mightily with how best to write worksheet/range/cell addresses in the code to facilitate code updates when changing worksheet layouts. Enums is such an elegant solution, especially with your demonstration’s use of a separate modConstants module & different enumerations to group those constants by category. Also, thank you for the demonstration of class module. I scratched my head at first asking “why is this better?” Then, I watched that section again, & it made sense. Such a simple technique that makes the main code easier to understand.
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
Thanks for the feedback Jim. When a project starts to grow you really notice the benefits of the enums.
@Diallo268
@Diallo268 4 жыл бұрын
I just like using the timer function. This is definitely a helpful video. I found a more crude way to use arrays years ago, but I've learned a lot since then.
@alterchannel2501
@alterchannel2501 2 жыл бұрын
Very usefull and informative channel. Thank you so much for this
@shoki92111
@shoki92111 4 жыл бұрын
The way of your teaching is really awesome..Sir 🙏
@zx-25r12
@zx-25r12 4 жыл бұрын
Im not into this level but this is amazing, optimizing to 10 times faster is insane
@wayneedmondson1065
@wayneedmondson1065 4 жыл бұрын
Hi Paul.. excellent tutorial.. still working my way through it. Lots of learning going on. Stay safe.. thanks.. and thumbs up!!
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
Thanks a lot Wayne.
@mike_case
@mike_case 4 жыл бұрын
Thank you Paul, great lesson :)
@thearchibaldtuttle
@thearchibaldtuttle 4 жыл бұрын
Nice! This is what I miss in many Excel solutions! Clean-up, refactoring and performance considerations are mostly unknown to macro recorder babies.
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
Thanks Archibald.
@ijimlyn
@ijimlyn 4 жыл бұрын
Thank you for sharing your knowledge. I’ve been searching for an advance tutorials like this and finally I found your channel. I would also like to request your expertise on table macros like how to add row in the table, deleting, updating etc..because this area Is prone to error for whatever reason...i hope you can add a tutorial to that.
@JohnOvens
@JohnOvens 4 жыл бұрын
Paul, this is fantastic - I plan to optimise some of the code that I have written for some personal projects. You have inspired me to do better.
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
Thanks John. I hope you are keeping well.
@frikduplessis3869
@frikduplessis3869 4 жыл бұрын
Morning Paul, How refreshing and motivating was this video 🤝 from a lockdown SA, Thank you so much this really made my day👌 and will help optimizing my new project I'm so grateful.
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
Thanks Frik.
@rods6405
@rods6405 4 жыл бұрын
Thanks for this needed a refresher. The funny thing is is all stupid adds for "monday dot com and online excel course" that youtube puts on before these Excel Macro Mastery videos when there is so much info in Excel Macro Mastery videos for free. Yep I have never used dictionary or collection I have always had more than 3 fields in all my work and home stuff. Lately if I have the data in a excel table or sheet I then use the Find All feature on the range to find matches to a data string it then returns a array of all the row matches it is faster than a for loop plus it looks across all cells in the range which is handy in the Sales application because you might want to return everything related to a model number or brand name.
@nadermounir8228
@nadermounir8228 Жыл бұрын
This is a perfect video. Just a quick question: do we have to create a class module in case we have more than 2 columns for a dictionary ?
@duaneorlovski
@duaneorlovski 4 жыл бұрын
This is a fantastic video! I really need to play around more with dictionaries and arrays.
@shashivishwakarma6302
@shashivishwakarma6302 4 жыл бұрын
Very informative content Mr Paul 👍
@KarthikKAVE
@KarthikKAVE 4 жыл бұрын
OMG, You are really Genius...! I don't how you remembering all those functions in a fingerprint.
@jrcryo
@jrcryo 4 жыл бұрын
Hello, When you used the enum for the magic numbers, why did you split one enum for rows and one for columns?
@jcare07
@jcare07 4 жыл бұрын
Excelente!
@serdip
@serdip 3 жыл бұрын
I did have some difficulty understanding adding rows to the array. I will have to rewatch the explanation of this technique in order to have a better grasp of the concept. I personally used a somewhat different approach to this solution, which is for me a bit easier. Leaving out most of the details, I propose the following broad outline to solve the problem: 1) Read the source data into a dictionary whose keys are the fruits and whose items are arrays of the dollar amounts from the Total column. If "Banana" occurs 4 times in the source data, the dictionary item for the key "Banana" will be an array having 4 elements 2) For each fruit in the criteria range , use the Max value to determine the number of rows in the output range for that fruit. 3) Populate the first column of the output range for a given fruit with that fruit. 4) Populate the second column of the output range for a given fruit with the elements of the array in the dictionary corresponding to that fruit, transposed of course. Note: If the array has 5 elements for "Banana" but the Max criteria is 3, the number of rows in the output range for "Banana" will be 3 and only the first 3 elements of the array will be assigned to the output range for "Banana". In other words, if the size of the range is less than the size of the array being assigned to it, Excel will just use the first N elements of the array and ignore the rest. Thank you kindly.
@Huynh-Tan-Quoc
@Huynh-Tan-Quoc 3 жыл бұрын
thanks so much.
@jlute10
@jlute10 4 жыл бұрын
Does this code actually do what is described in the beginning about getting the max? Seems to me like it gets the first number of each fruit. For instance @19:54 you can see it is supposed to get the top 2 Bananas (which manual evaluation would be 7291 and 7109) but it returns 7291 and 1937. Perhaps a sort function could be added before your expiation method is used such that the highest values per fruit are always on top?
@grahamparker7729
@grahamparker7729 4 жыл бұрын
Another great video 👍🏻
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
Thanks again!
@konatesiakamounir8704
@konatesiakamounir8704 4 жыл бұрын
Dim key As Variant, amount As Long For Each key In dict amount = dict(key) If amount > 150000 Then dict(key) = CLng(amount - (amount * 0.1)) End If Next key Set ApplyDiscount = dict I want to calculate hours instead of sums
@frankh2357
@frankh2357 4 жыл бұрын
Is there a way to speed up Pivot Filter looping? I have code where my buttons apply filtering for reports. But it generally takes 30-45 sec to loop through my pivot tables. 😕
@konatesiakamounir8704
@konatesiakamounir8704 4 жыл бұрын
Thank you, teacher, for this course but I have a problem I have hours of work in my table instead of the sums that can help me calculate this? I want to speak this video "How to design and code an Excel VBA application like a pro"
@davidkirk7769
@davidkirk7769 4 жыл бұрын
Does this work on Excel for Mac
@serdip
@serdip 3 жыл бұрын
Thanks for posting this very informative and interesting video! It demonstrates a lot of advanced techniques that make for a robust and elegant solution. I would imagine that using named ranges might make the code more flexible. The problem of how to return multiple items from a function was solved in the video using a class, which is very elegant. Would you also consider returning an array or a dictionary a viable alternative? I think that it might be helpful if a procedure in the Workbook_Open event were to be called that would read all of the source data into a global array. That way it wouldn't be necessary to read the source data each time the Report button is clicked.
@imranbhatti8580
@imranbhatti8580 4 жыл бұрын
Hello Paul! Nice video. But these libraries (collection and dictionary) are not suitable when it comes to larger data sets. I always try to avoid loops What you do for huge data sets? say 50000+ record sets.
@Rkeev1
@Rkeev1 4 жыл бұрын
great use of dictionary.
@kike6691
@kike6691 3 жыл бұрын
I love you
@jnorton47a
@jnorton47a 2 жыл бұрын
I am having a problem that I need help with. When I get to the line of code Set "rg = shFruit.Range("F3").CurrntRegion" I get a "Variable not defined" error. The code looks exactly like the code in the video. What do I have wrong?
@Excelmacromastery
@Excelmacromastery 2 жыл бұрын
ShFruit should be a worksheet object.
@jnorton47a
@jnorton47a 2 жыл бұрын
@@Excelmacromastery Sorry I still do not get it. Do you mean the sheet needs to be named Fruit? If so I still get the same error. Can you please be more specific?
@rods6405
@rods6405 4 жыл бұрын
I really need to get "CurrentRegion.Value" tattooed on my arm
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
😂😂
@redangrybird7564
@redangrybird7564 4 жыл бұрын
I learnt that fruit is expensive in the UK. ✌😀
@philipsombilon8519
@philipsombilon8519 4 жыл бұрын
Good Morning. Please make a code for add and updating data in listbox
@MGDLProductions
@MGDLProductions 4 жыл бұрын
Hi Paul, once again an excellent video. I'm confused by the function AddArrayRow and how it is used in the ReadData. Obviously it works, but for me I expected it to look something like this: result = AddArrayRow(result, row, arr, i) Can you explain how/where the variable result get the data in your line: AddArrayRow result, row, arr, i I haven't seen this kind of use before, I expect a equal sign like in my example. Can't figure it out...
@Excelmacromastery
@Excelmacromastery 4 жыл бұрын
That's a great question Mikael. When an array is passed as parameter we are passing a reference to an array. This means that when we change the array in ArrArrayRow we are changing the original array. We don't need to pass it back from the function. From a readability point of view it is better but doing it slows the code down a lot. -Paul
@FredrikDahlberg
@FredrikDahlberg 4 жыл бұрын
Your videos are awesome. But please, check your mic. Watching your this video with a subwoofer was a pain. Check how you handle the sound. The whole room shakes when you hammer your keyboard. Not ok.
@tughanozsezer9332
@tughanozsezer9332 4 жыл бұрын
🤟
@yashchawla8360
@yashchawla8360 4 жыл бұрын
It's too easy to hack excel vba password. Can you help us with tricks to lock vba at a better level???
@aphinphin65
@aphinphin65 4 жыл бұрын
Jj
Make Your VBA Code Run 1000 Times Faster (Part 2)
16:34
Excel Macro Mastery
Рет қаралды 43 М.
Reduce VBA Errors by 90% (with this little-known Method)
16:59
Excel Macro Mastery
Рет қаралды 59 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Office Scripts vs Excel VBA (Everything you need to know)
25:08
Excel Macro Mastery
Рет қаралды 74 М.
7 Simple Practices for Writing Super-Readable VBA Code
13:03
Excel Macro Mastery
Рет қаралды 68 М.
How to Design and Code an Excel VBA Application Like a Pro
42:27
Excel Macro Mastery
Рет қаралды 220 М.
Enums(Enumeration): The Key to Cleaner, More Efficient VBA Code
9:58
Excel Macro Mastery
Рет қаралды 32 М.
The 7 Keys Areas of Excel VBA (with code examples)
28:00
Excel Macro Mastery
Рет қаралды 66 М.
5 VBA Hacks Everyone Should Know in 2021
11:20
Excel Macro Mastery
Рет қаралды 92 М.
How to get the Last Row in VBA(The Right Way!)
15:41
Excel Macro Mastery
Рет қаралды 167 М.
VBA Classes - The Definitive Guide
31:03
Data Ben
Рет қаралды 37 М.
Advanced Filters: Master These Simple Filtering Hacks In Excel VBA Today
23:26
Excel For Freelancers
Рет қаралды 13 М.
Excel VBA: The Little-known secrets of ByVal and ByRef
13:00
Excel Macro Mastery
Рет қаралды 47 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН