Тёмный

How to Use Arrays Instead of Ranges in Excel VBA 

Excel Macro Mastery
Подписаться 84 тыс.
Просмотров 195 тыс.
50% 1

Learn how to write real-world Excel VBA code: 👉courses.excelmacromastery.com/
FREE CHEAT SHEET: Get the free cheat sheet on VBA arrays here: (bit.ly/2MXsnz9)
Subscribe to the channel here: bit.ly/36hpTCY
How to Use Arrays Instead of Ranges in Excel VBA
Most people don't realise that Arrays are exponentially faster than Ranges in Excel VBA.
In this video I cover in detail how to replace ranges with arrays and make your code run faster.
Useful VBA Shortcut Keys:
View the Immediate Window: Ctrl + G
View the Watch Window: Alt + V + H
Tab: To move lines of code to the right(Indent).
Shift + Tab: To move lines of code to the left(Outdent).
Shift + F2: Get the definition of the item under the cursor.
Ctrl + Shift + F2: Go to the last cursor position.
Ctrl + Space: AutoComplete Word.
Alt + F11: Switch between Excel and the VBA Editor.
Ctrl + G: view the Immediate Window
Ctrl + R: View the Project Explorer Window.
Ctrl + Shift + 8(or Ctrl + *): Get the current region on a worksheet.
F4: View the Properties Window.
F5: Run the code from the current sub.
F8: Step into the code.
F9(or click left margin): Add a breakpoint to pause the code.

Опубликовано:

 

3 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 260   
@Excelmacromastery
@Excelmacromastery 5 дней назад
Learn how to write real-world Excel VBA code: 👉courses.excelmacromastery.com/
@BenjaminHouot
@BenjaminHouot 4 года назад
Best vba channel i ever found !
@emmanuelgonzalezescobar2114
@emmanuelgonzalezescobar2114 4 года назад
X2
@1802bask
@1802bask 3 года назад
Dear Kelly Thank you and I want to learn more about Excel VBA
@mike_case
@mike_case 4 года назад
Thank you Paul for all your content!!! Dictionaries, arrays, collections and classes are the best.
@krn14242
@krn14242 4 года назад
Great job Paul. Love using arrays now. So much more efficient.
@TimePasser
@TimePasser 3 года назад
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 .
@terryy6938
@terryy6938 3 года назад
Absolutely a clear and concise explanation of using arrays. Well done! You gained another subscriber.
@davidevecchio2474
@davidevecchio2474 3 года назад
Thanks a lot! A very clear explanation that addressed exactly what I was looking for. You're a great teacher!
@querrythis
@querrythis 2 года назад
Incredible how efficient you codes are, yet explain it so simple. Genius!
@gonzaortin739
@gonzaortin739 Год назад
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
@Excelmacromastery
@Excelmacromastery Год назад
Thanks Gonza
@johnhackwood1568
@johnhackwood1568 4 года назад
Another really 1st class video, really simple and robust code that covers so many practical situations
@jastonkong1409
@jastonkong1409 3 года назад
Clear and concise, I love it!!!
@cherifnadjib3373
@cherifnadjib3373 4 года назад
From Algeria, thank you Paul for this vidéo.
@redfeather22sa
@redfeather22sa Год назад
Best Video on the Interweb , Internet & Galaxy !! Star Paul !! Your an Amazing Star !!
@luismoreyra6804
@luismoreyra6804 2 года назад
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!!
@natejewkes
@natejewkes 4 года назад
Where have you been all my life? This is awesome!
@grzesiekhallomoto5920
@grzesiekhallomoto5920 4 года назад
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...
@stevennye5075
@stevennye5075 4 года назад
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.
@peajayjay3622
@peajayjay3622 Год назад
Absolutely loved this tutorial! Thank you sir!
@EduardoRibeiroEdu
@EduardoRibeiroEdu 4 года назад
Thanks Man! you and Leila are the best in excel tips!
@Akens888
@Akens888 4 года назад
Thanks for uploading this Paul.
@m-squaredcontractors9720
@m-squaredcontractors9720 4 года назад
Wow...i now really appreciate arrays. Very efficient compared to ranges. Thanks Paul
@fmichaelhemmer3762
@fmichaelhemmer3762 2 года назад
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.
@Excelmacromastery
@Excelmacromastery 2 года назад
Glad you liked it Michael.
@cortinas54
@cortinas54 4 года назад
as always all your videos are amaizing and greats!
@minhphan3580
@minhphan3580 4 года назад
You sir, are next level. AMAZING!!!
@Mandelbrot567
@Mandelbrot567 4 года назад
I have done some of this before, but not the resize aspect. Great tips, thanks Paul.
@jxggxr_dxv
@jxggxr_dxv 4 года назад
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.
@Excelmacromastery
@Excelmacromastery 4 года назад
Thanks
@franciscovwilliams
@franciscovwilliams 4 года назад
Amazing explanation! Congrats!
@veebee3969
@veebee3969 Год назад
Thank you. Great video.
@danielgomezmendoza4851
@danielgomezmendoza4851 Год назад
You helped so much, thank you!
@donbogdala5428
@donbogdala5428 Месяц назад
Awesome work!
@MGE0007
@MGE0007 3 года назад
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!)..
@csemanate
@csemanate 4 года назад
Learning a lot. Thanks!!
@frikduplessis3869
@frikduplessis3869 4 года назад
Thank you Paul a brilliant video again,
@Victor-ol1lo
@Victor-ol1lo 4 года назад
Great video !! Thanks for sharing with us !
@andrewbeeby2887
@andrewbeeby2887 4 года назад
Great VBA teacher, I've tried various different tutorials and keep coming back here!
@Excelmacromastery
@Excelmacromastery 4 года назад
Thanks for your support my videos Andrew
@manassehkisame6286
@manassehkisame6286 2 года назад
This video got me up a high wall...by making my code cut thru a dead end(error) and in a fast way...Genius!
@alexkim7270
@alexkim7270 4 года назад
Thank you so much! This is great.
@mangobrother
@mangobrother 4 года назад
Thank you so much. Great video. I am learning a lot. Very useful tips.
@davidlinton4127
@davidlinton4127 3 года назад
Great stuff Paul, big fan From Florida USA....
@choijaeho653
@choijaeho653 2 года назад
Thank you so much for the very useful tips using arrays in vba!! :)
@Ts18762
@Ts18762 Год назад
Mindblowing 💯💯
@redangrybird7564
@redangrybird7564 Год назад
Mr Kelly, you are a champion 🏆 😎👍
@niczoom
@niczoom 3 года назад
Great tips, thanks!
@haiderbokhari1
@haiderbokhari1 4 года назад
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!!
@entropyincrease1
@entropyincrease1 2 года назад
You're a beast. Your content is the best.
@chandrachurdatta5844
@chandrachurdatta5844 2 года назад
20 Minutes to 33 seconds!!! Thank you very much.
@coryc9040
@coryc9040 4 года назад
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.
@1yyymmmddd
@1yyymmmddd 4 года назад
Great video ! Thanks !!!
@hericklenin
@hericklenin 4 года назад
Thanks a lot, this is awesome.
@jeffgrant6004
@jeffgrant6004 Год назад
Fatastic video. Thanks
@Neckbeef82
@Neckbeef82 Год назад
Has to be the best vba tutorial I've seen on RU-vid. 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
@Excelmacromastery
@Excelmacromastery Год назад
Glad you liked it.
@sonderfall1979
@sonderfall1979 4 года назад
BEST VBA ADVICE EVER!!!! Wow, you are awesome :-)
@Excelmacromastery
@Excelmacromastery 4 года назад
Glad you think so!
@Deepti1512
@Deepti1512 9 месяцев назад
Very nice explanation..... keep it up ....
@rrrprogram8667
@rrrprogram8667 4 года назад
Awesome paul.... U r the master of vba... Great to have u as a teacher
@Excelmacromastery
@Excelmacromastery 4 года назад
Glad you like it.
@fritzbaden8085
@fritzbaden8085 3 года назад
This guy is a frickin' genius.
@vijaysahal4556
@vijaysahal4556 4 года назад
superb sir
@scotolivera8207
@scotolivera8207 4 года назад
Amazing teacher, each video I watch I learn a new trick. Thanks a lot
@Excelmacromastery
@Excelmacromastery 4 года назад
Thanks for your comment George
@petermaina7111
@petermaina7111 3 года назад
you are a G.O.A.T. probably also take us through append
@MrAshfaqahmed
@MrAshfaqahmed 3 года назад
Great work Sir, you real world examples are so fascinating. I have a question to in the same situation.
@jawalim1996
@jawalim1996 3 года назад
amazing video, thanks, you are my best vba mastery legend.
@Excelmacromastery
@Excelmacromastery 3 года назад
Wow, thanks
@shumzbeazley7056
@shumzbeazley7056 3 года назад
Thank you 💜
@godisalmighty4449
@godisalmighty4449 Год назад
Excellent
@gianludisc7148
@gianludisc7148 3 года назад
Yooo this is sick
@shrutikadongre1046
@shrutikadongre1046 2 года назад
Thankyou so much for this tutorial, really helped me a lot! and saved my time.. thanks a lot yet again!! :))
@tymothylim6550
@tymothylim6550 4 года назад
Thank you for the video :) It was helpful for me.
@Excelmacromastery
@Excelmacromastery 4 года назад
Glad it helped!
@ghalebevaldo4416
@ghalebevaldo4416 3 года назад
Great,thanx
@garyknight6766
@garyknight6766 4 года назад
Always great stuff, very well presented
@Excelmacromastery
@Excelmacromastery 4 года назад
Thanks Gary
@b3lg4r4th8
@b3lg4r4th8 4 года назад
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.
@adammorait7429
@adammorait7429 3 года назад
Many thanks, excellent and well explained, it is crystal clear, your video helped me a lot.
@Excelmacromastery
@Excelmacromastery 3 года назад
Glad you liked it Adam.
@Imobajuda
@Imobajuda 4 года назад
Excellent video.!!!!!!!!!!!!!
@Excelmacromastery
@Excelmacromastery 4 года назад
Thank you very much!
@SuiGenerisGuy
@SuiGenerisGuy 4 года назад
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
@Excelmacromastery
@Excelmacromastery 4 года назад
If you use Set with a variant to a range it will return the range rather than the array.
@hemant0088
@hemant0088 4 года назад
Awesome content. Keep sharing useful tips and tricks. It is much helpful for developers life. :) :)
@victormln1214
@victormln1214 3 года назад
EXCELLENT SUPER
@stevennye5075
@stevennye5075 4 года назад
very useful
@smanzoli
@smanzoli 2 года назад
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!
@Excelmacromastery
@Excelmacromastery 2 года назад
That's great to hear.
@TheJaebeomPark
@TheJaebeomPark 3 года назад
Awesome!
@shafiqarzayeva8799
@shafiqarzayeva8799 4 года назад
Thanks a lot!!!))
@mahdizahzah51
@mahdizahzah51 4 года назад
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
@BabyBugBug
@BabyBugBug 4 года назад
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!
@domenicoieracitano2138
@domenicoieracitano2138 Год назад
Why does this have only 69k views? It should be on the top of the recommendations on RU-vid!
@satishk2410
@satishk2410 4 года назад
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
@Excelmacromastery
@Excelmacromastery 4 года назад
You're welcome!
@RyuBeach
@RyuBeach 4 месяца назад
설명감사합니다
@jurijdmitrenko5753
@jurijdmitrenko5753 4 года назад
Wau, it is very very good 👍😲
@renenielsenring1037
@renenielsenring1037 4 года назад
Wow, thanks 😊😊
@Excelmacromastery
@Excelmacromastery 4 года назад
You're welcome!
@BeingUnknown
@BeingUnknown 3 года назад
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!!
@harrys1176
@harrys1176 4 года назад
What a legend
@eduarchavarria
@eduarchavarria 4 года назад
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.
@henrikijonkoping4694
@henrikijonkoping4694 3 года назад
You can @ Eduardo Chavarria
@javedahmed8343
@javedahmed8343 2 года назад
Nice
@muhammadnauman3048
@muhammadnauman3048 4 года назад
Great
@gd6noob
@gd6noob 3 года назад
Always loved watching your videos. Just a quick question. How can I adjust this to lets say I want Columns A, C to E.
@shaikhaziz9703
@shaikhaziz9703 3 года назад
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.
@orlandoeulate1723
@orlandoeulate1723 Год назад
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
@mthwmwn7844
@mthwmwn7844 3 года назад
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?
@user-yk2sg5pd5g
@user-yk2sg5pd5g 4 года назад
Paul, Thank you for great instruction. Is it possible if I do samething with a recordset pulled out of query?
@pentatradeagency3343
@pentatradeagency3343 Год назад
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.
@TheJoeFletch
@TheJoeFletch 8 месяцев назад
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.
@priyankagupta951
@priyankagupta951 3 года назад
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?
@bonniebaker6226
@bonniebaker6226 2 года назад
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?
@NabhdeepBansal
@NabhdeepBansal 3 года назад
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??
@kethanchordia
@kethanchordia Год назад
06:49 - Was Wow--- In one line we can paste the range that we work on
@cvmotta
@cvmotta 2 года назад
You video substitute at least 500 array videos abd common explanations, 'BEST IN CLASS"
Далее
How to make your Excel VBA code run 1000 times faster
16:55
VBA Array with Filter, Sort and Slice (2021)
15:55
Просмотров 54 тыс.
DO NOT Dunk Here ❌🏀
00:20
Просмотров 7 млн
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
Rope climb tutorial !! 😱😱
00:22
Просмотров 2,2 млн
The Ultimate Guide to Copying Data using Excel VBA
31:05
How to Use Class Interfaces in Excel VBA
20:16
Просмотров 78 тыс.
Referencing Dynamic Arrays with Tables
16:56
Просмотров 23 тыс.
Excel VBA Introduction Part 25 - Arrays
1:00:24
Просмотров 227 тыс.
How to get the Last Row in VBA(The Right Way!)
15:41
Просмотров 152 тыс.
Introducing Python in Excel
19:01
Просмотров 1,5 млн
Excel VBA Collections: Collections vs Arrays (4/5)
15:14
DO NOT Dunk Here ❌🏀
00:20
Просмотров 7 млн