How to Master VBA loops FAST (with real coding examples)

preview_player
Показать описание

How to Master VBA loops FAST (with real coding examples)

VBA has 4 types of loops and one of these loops can be written in 4 ways. This leads to a lot of confusion. In this video
I am going to show you exactly what each loop is for and when to use it and which loops you can avoid

#ExcelVBALoops #VBADoUntil #VBADoWhile

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
Repeat last search: 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)
Рекомендации по теме
Комментарии
Автор

I am great at deciphering others code and tweaking to suit my needs, I couldn't write a loop to save my life. Looking forward to this tutorial. Thanks

clintg
Автор

Excellent and simple way explain. Post more advance vba like Update and changed in google sheet using excel vba.

vincenttrichy
Автор

Thank heaps paul. Can you please put online nested dictionary tuto, i have tried it well based on your videos on dictionary, but want to improve it at the best

ousmanetall
Автор

Nice Opinion :) Personally only ever used For or Do until.

jameswilliams
Автор

I learned about the Do Loop because I wanted to exit the loop early under some conditions. It's done with Exit Do. The While loop doesn't have anything like that to break the loop.

bredmond
Автор

Please, Mr. Paul, we would like you to go into depth on the concepts of object-oriented programming in VBA with applied projects.

hammeedabdo.
Автор

Very useful information about looo tq sir 😊

vijaysahal
Автор

Hello, so i have a lot of pdf urls to download, probably like 1000. How can i download the bulk all at once? like i wanna put all 1000 url in sheet & click 1 button to download it all, is that possible? since do it manually would take ages. Also the i need to login (username & password) first so i can have access to the pdf urls, can u help? thanks so much!

EmmaMyler
Автор

I got tired of loops, so I ended up switching to GoTo statements which are much easier to use and understand without all that finicky syntax.

flameofthephoenix
Автор

Hi very off topic question, do you know how some accounting softwares have vba developed that can create reports and export data to excel. My question is how do they do that? Where do I begin to learn how to do this? Thanks.

Matt-zpjg
Автор

that was great thank you, however am its giving me error 400 once using do while in this code: "Do while sheet2.cells(R, 4)<>"" "". where is the error in this. will very much appreciate your feedback.

BassamThebian
Автор

Hi Paul, as usual, again a great video from your side!😊 Thanks a lot for your work!🦾😉

johnwayne
visit shbcf.ru