7 Simple Practices for Writing Super-Readable VBA Code

preview_player
Показать описание
👉 Ready to master VBA?
(Note: If the download page doesn't work then make sure to turn off any popup blockers)

7 Simple Practices for Writing Super-Readable VBA Code

Having readable code is vital. It makes understanding your code easy to update and easy to understand.

But most important of it will slash the number of errors in your code. You can waste a lot of time fixing errors so this is very important.

In this video I show 7 simple techniques that will make your code readable.


Useful VBA Shortcut Keys:
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 + 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.
F9(or click left margin): Add a breakpoint to pause the code.
Рекомендации по теме
Комментарии
Автор

my coworkers will have to thank you :)

MrDoomfighter
Автор

Hi everyone,


Enjoy your watching and please leave your comments below. Don't forget to press SUBSCRIBE my channel for more videos.


Thanks for your support.

Excelmacromastery
Автор

Good stuff! Putting the dim statements within the code rather than at the top was new to me.

justinfazzio
Автор

It serves no one for a programmer to take shortcuts in naming and other tasks to save typing. very descriptive names are essential to good coding. It is also essential to use subroutines to compartmentalize the code for simplicity in making changes and separating concerns.
It is good to see someone make a video like this for VBA as I get the feeling these things are taken lightly by VBA programmers.

RollinShultz
Автор

Enum - learn something new every time I watch your videos. Thanks, Paul!

dangelorrrr
Автор

Been VBAing for 30years did not know about Ctrl+space autocomplete worked on a blank line thanks heaps!
Have watched many of your videos and have implemented many changes to speed my code up thanks!
Will watch all your videos now!

rods
Автор

Sir, one of the best Excel youtube channels.

YKazimir
Автор

Just amazing. Thank you for your videos and page.

sislmira
Автор

Paul, thank u very much for ur videos, they are so super useful. i have learned a lot from u.

grzegorz
Автор

Just found your channel...loving it! I’ve been a VBA Developer for about 7 years and I learn something from every one of your videos!

RichardCookerly
Автор

Thank you for teaching the developers, these are very important principles.

szabolcsjobbagy
Автор

Many thanks, it really helps! Appreciate your anonymous effort.

edwardlee
Автор

Hi Paul.. these are 7 super tips.. really helpful and will implement them right away.. especially declaring variables where I use them and giving variables friendly names. When first learning, it seems correct to mimic what we see others doing.. so.. bad habits get passed through the generations. Thanks for this great advice to chart my own course and develop my own style. Thumbs up!!

wayneedmondson
Автор

I was able to learn to code by myself but thanking for teaching me best practices. Deeply appreciate it.

nelsonrioux
Автор

Continuously watching your video... Great topics and useful in vba.

officetricks
Автор

A different color for parentheses and array values helps a lot :)

grigull
Автор

6:41. Magic numbers, leading into demonstration of ENUMS.

houstonvanhoy
Автор

I didn't know about Enum, this can really make my code much more readable. Thank you so much for sharing these best practices!

mikhailk
Автор

Still exploring what VBA can offer and how to use it, but deffinitly this makes the jurney easier :)

tojtowny
Автор

I don't use anymore "i" or "j" as a variable. I prefer to use "For Row = 1 to NbRows", Or "For Col = 1 to ..."
It is more clear.

BenjaminHouot