No video

How I Made 2 VBA Applications Run Ultrafast

  Рет қаралды 53,935

Excel Macro Mastery

Excel Macro Mastery

Күн бұрын

👉 Ready to master VBA?
- Check out my full courses: courses.excelm...
- Subscribe to the channel here: bit.ly/36hpTCY
How I Made 2 VBA Applications Run Ultrafast
In this video, I take two extremely slow Excel VBA applications and I make them run in under a second. First of all, I will show you how long they take
to run and then I will show you the steps to make them increase their speed exponentially. If your VBA applications are running slowly then this video is for you.
#ExcelVBA #VBASlowCode #VBACodeFast
Dictionary Playlist: • Excel VBA Dictionary
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
Auto complete 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)

Пікірлер: 54
@alterchannel2501
@alterchannel2501 11 ай бұрын
You're my teacher n. 1 for VBA. Please don't stop posting. even if excel has improved a lot, with new formulas, power query and power pivot, we still need our good old VBA !!!
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
Thanks. I plan to keep going.
@AnilKumar-vi8oe
@AnilKumar-vi8oe 11 ай бұрын
Love to see you back again, keep bringing these
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
Thanks
@Squeeonline
@Squeeonline 11 ай бұрын
It's interesting to a see a professionals take on this. The first problem, I would have just filtered the column searching for 0, then deleted all rows, then removed the filter. On datasets of a few hundred rows, this works very fast.
@baphnie
@baphnie 11 ай бұрын
If it takes you 4 minutes to loop over 10 rows of data, you don't need a better algorithm; you need a new computer.
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
Not to loop but to delete individual rows.
@peterhuntervogel
@peterhuntervogel 11 ай бұрын
You're missing the point: the time is spent deleting even a single row in a list of "thousands of rows."
@sunildhyani904
@sunildhyani904 11 ай бұрын
😊😊😊😊😊😊😊😊@😊😊
@hcandts
@hcandts 10 ай бұрын
Great (as always) you shed new light on what we have done by habit
@MrStuartAllan
@MrStuartAllan 10 ай бұрын
Brilliant video! I always learn something new when I watch one of your videos. If you are able to, could you share the Timer code?
@kukuhwahyurinaldi6288
@kukuhwahyurinaldi6288 11 ай бұрын
It's been a while Mr Paul Kelly, since a last video about Vba. I still need learn a lot from U.. please don't get bored to teach us.. Thanks🙏
@fitosferenc
@fitosferenc 11 ай бұрын
I am using this method: Sort, Filter, Delete visible lines exept header, filter off: ActiveSheet.UsedRange.Offset(1).SpecialCells(xlCellTypeVisible).Delete Shift:=xlUp
@michaelangellotti5741
@michaelangellotti5741 11 ай бұрын
Your work is excellent. Thanks for sharing.
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
Glad you like it
@madmaxhaskovo
@madmaxhaskovo 11 ай бұрын
Nice video, but may I ask for a link to that Timer class? Thanks in advance!
@iliesmeziani
@iliesmeziani 10 ай бұрын
thank you very much for this video which is interesting. please can you share with us the excel file of this course. best regards
@BenLinfordUK
@BenLinfordUK 11 ай бұрын
Lovely, Paul, and pretty ironic as I put together a very similar routine yesterday, except I captured an array of the values across all columns within the records with the same 'famCode'. Then I looped across the rows in each column of that array, storing the first value as the string for comparison and comparing each subsequent value within that column of the array against it. If it didn't equate to the comparison string, I mapped out that column in the array to the equivalent range in the worksheet, applied formatting to highlight and exited out of that column to resume looping. Very much inspired by your Array-Dictionary combination techniques for speed. 🤩🙏
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
That is a coincidence. Thanks for the feedback Ben.
@munshirasimraja5713
@munshirasimraja5713 11 ай бұрын
Thanks for wonderful technique that save a lot time.😊
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
You're welcome.
@josephdaquila2479
@josephdaquila2479 9 ай бұрын
I find it interestinf you seem to get a performance increase by disabling events even if you don't have any actions assigned to those events.
@mathijs9365
@mathijs9365 11 ай бұрын
Create table. Load in power query en load back in Excel.
@renziair
@renziair Ай бұрын
I think this can also be done using Union and delete all the 0's at once. Sorting won't be required.
@bestoptimate
@bestoptimate 14 күн бұрын
Mr. Paul, I find your videos very helpful in my tasks. Can I ask a question? My dataset column 'D' has integer values in it, along with zeros in some cells. How can I force the Find function to just look for '0' in whole cell, instead of looking for '0' in figures say 76,000?
@LoneIcon
@LoneIcon 11 ай бұрын
In your 2nd topic, i think using the Dictionary method is the best option in an instance when "Count FC" inidcator isnt present.
@SolutionsByPVV
@SolutionsByPVV 11 ай бұрын
Thank you, Paul! I would like a tutorial on VBA interaction with messengers: Telegram, Viber, WhatsApp. Your best practices on this topic.
@Bhavik_Khatri
@Bhavik_Khatri 11 ай бұрын
Excellent tutorial!
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
Thanks
@SolutionsByPVV
@SolutionsByPVV 11 ай бұрын
Paul, link please file from this tutorial to download.
@thiyagarajan1989
@thiyagarajan1989 8 ай бұрын
Can you Upload Sample Data- Excel Sheet ...Which will help many people....
@ZoltanGrose
@ZoltanGrose 11 ай бұрын
I’m wondering if the external workbook references is what was making the Delete slow if the workbook isn’t open…
@ousmanetall1286
@ousmanetall1286 11 ай бұрын
Hi Paul, I am from Senegal. I really appreciate your sharing knowledge. However, I would like to know how I can't subscribe through payment by card from my country to get more of your lessons.
@edysaputratech3645
@edysaputratech3645 10 ай бұрын
How to scrape data from web with login
@ManojYadav-nt2rm
@ManojYadav-nt2rm Ай бұрын
it looks like you dont like the for loop in your code.
@jonelatendido9836
@jonelatendido9836 6 ай бұрын
Please give the files, Or Just the code in a texf files, it would help a lot..
@CB27
@CB27 11 ай бұрын
1st example, why not simply Data/Filter/Autofilter for zeros and then delete the filtered rows?
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
It is slower than the method I used.
@CB27
@CB27 11 ай бұрын
@@Excelmacromastery ah yes, I fell into the trap of thinking what's easiest when doing it manually through the UI. Execution wise, I can see how your method would be faster.
@TravisFX
@TravisFX 8 ай бұрын
Hey man.. So call me late to the party, but is vba seriously dead with subscr online ver of MS365? Even the paid version? Am lookin to finally upgrade my old excel version...Reading all about the benefits of buying the subscription MS 365 office vs the old one time buy/install version. No create or run any vba at all? How is that possible with millions of vba files out there. I hear office 365 excel desktop ver still does vba...But whats the point...u cant give it to someone using 365 online?!!
@Excelmacromastery
@Excelmacromastery 8 ай бұрын
MS365 I'd subscription based with updates where as Office 2021 is once off payment. Both are desktop versions of office. 365 includes an online version of Excel. Online isn't replacing desktop. It's just an alternative way of editing an Excel file.
@DimaEarth
@DimaEarth 10 ай бұрын
Заметил русское название файла))
@ManojYadav-nt2rm
@ManojYadav-nt2rm Ай бұрын
this is not the great solution without toucing the data you shld make the code run faster
@tonynichols1638
@tonynichols1638 11 ай бұрын
Mn
@TP-om8of
@TP-om8of 11 ай бұрын
Take home message: MS Excel is a dinosaur. (You could have read the data into an array and done the deletion there, on the first one too. Why didn’t you?)
@quench100
@quench100 11 ай бұрын
I had a sheet with 16,000 rows with a similar problem. I tried both methods: delete via array, and delete after sorting. Sorting is way faster, especially when the cell contents are formulas.
@Excelmacromastery
@Excelmacromastery 11 ай бұрын
The solution required keeping the formatting of the records and because sorting was faster.
@TP-om8of
@TP-om8of 11 ай бұрын
@@quench100 How about Power Query. It would be fine befire more. You opened the VBA editor.
@quench100
@quench100 11 ай бұрын
@@TP-om8of I've never used Power Query, I'm using Excel 2013.
@mathijs9365
@mathijs9365 11 ай бұрын
Yep. Power Query is an ETL programm. Perfect for cleaning data.
@ganeshs1360
@ganeshs1360 10 ай бұрын
=MIN(FILTER($C$2:$C$1048576,$B$2:$B$1048576=b2,"")) but its always good to know a new VBA approach.
I Made this VBA Code 2,880,952% faster
12:21
Excel Macro Mastery
Рет қаралды 25 М.
Watch these 28 minutes if you want to become an Advanced VBA user...
29:01
Excel Macro Mastery
Рет қаралды 52 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 12 МЛН
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 3,6 МЛН
КАКУЮ ДВЕРЬ ВЫБРАТЬ? 😂 #Shorts
00:45
НУБАСТЕР
Рет қаралды 3,4 МЛН
Do You Need to SWITCH from Excel VBA Macros to Office Scripts?
13:02
Leila Gharani
Рет қаралды 379 М.
How to get the Last Row in VBA(The Right Way!)
15:41
Excel Macro Mastery
Рет қаралды 157 М.
Excel VBA - How to use Excel Table in VBA
15:28
Tech Sessions
Рет қаралды 8 М.
5 VBA Hacks Everyone Should Know in 2021
11:20
Excel Macro Mastery
Рет қаралды 90 М.
How to use ChatGPT to maximize your VBA skills
12:04
Excel Macro Mastery
Рет қаралды 26 М.
The Ultimate Guide to Copying Data using Excel VBA
31:05
Excel Macro Mastery
Рет қаралды 65 М.
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 159 М.
Run Python Code From Excel with VBA
14:32
NeuralNine
Рет қаралды 36 М.
Is PYTHON or VBA better? Which language should you learn? 🤔
11:47
Enums(Enumeration): The Key to Cleaner, More Efficient VBA Code
9:58
Excel Macro Mastery
Рет қаралды 30 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 12 МЛН