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

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • Learn how to write real-world Excel VBA code: 👉courses.excelm...
    Subscribe to the channel here: bit.ly/36hpTCY
    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)

ความคิดเห็น • 25

  • @Excelmacromastery
    @Excelmacromastery  3 หลายเดือนก่อน

    FLASH SALE: 25% off my Effective Excel VBA course before Saturday 14th September: 👉courses.excelmacromastery.com/courses/Effective_Excel_VBA
    Learn how to write real-world Excel VBA code: 👉courses.excelmacromastery.com/

  • @clintg3435
    @clintg3435 11 หลายเดือนก่อน

    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

  • @vincenttrichy
    @vincenttrichy 11 หลายเดือนก่อน +1

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

  • @bredmond812
    @bredmond812 11 หลายเดือนก่อน +1

    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.

    • @Excelmacromastery
      @Excelmacromastery  11 หลายเดือนก่อน +1

      Yes, the Do loop is more flexible.

  • @vincentlee7995
    @vincentlee7995 11 หลายเดือนก่อน +1

    Great video. Thank you Paul!

  • @ousmanetall1286
    @ousmanetall1286 11 หลายเดือนก่อน +1

    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

  • @hammeedabdo.82
    @hammeedabdo.82 11 หลายเดือนก่อน

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

  • @jameswilliams5045
    @jameswilliams5045 11 หลายเดือนก่อน

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

  • @flameofthephoenix8395
    @flameofthephoenix8395 8 หลายเดือนก่อน

    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.

  • @tracywang1
    @tracywang1 หลายเดือนก่อน

    Nice

  • @kukuhwahyurinaldi6288
    @kukuhwahyurinaldi6288 11 หลายเดือนก่อน

    Thanks Suhu🙏🙏

  • @vijaysahal4556
    @vijaysahal4556 11 หลายเดือนก่อน

    Very useful information about looo tq sir 😊

  • @vijaysahal4556
    @vijaysahal4556 11 หลายเดือนก่อน

    Great sir ❤

  • @EmmaMyler
    @EmmaMyler 6 หลายเดือนก่อน

    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!

  • @Matt-zp9jg
    @Matt-zp9jg 11 หลายเดือนก่อน

    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.

  • @TP-om8of
    @TP-om8of 11 หลายเดือนก่อน

    Don’t loop, vectorise!

  • @BassamThebian
    @BassamThebian 8 หลายเดือนก่อน

    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.

  • @johnwayne8059
    @johnwayne8059 11 หลายเดือนก่อน +1

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