5 Simple Tips for Making BETTER Macros in Excel!

  Рет қаралды 6,466

TeachExcel

TeachExcel

Күн бұрын

Пікірлер: 8
@grisheldamarks-webster-noa1706
@grisheldamarks-webster-noa1706 Жыл бұрын
Hello, Is there a similar function like macros that allows you to hide rows based on a cell value (dropdown menu)? I started with macros but the clients were having trouble with the workbooks. I am currently using excel 2016, I can upgrade to a non- subscription version if need be. Thanks
@rcwagon
@rcwagon 2 жыл бұрын
So ByVal is a closed valve that prevents flow, and ByRef is an open valve that lets its value flow through. Not a solid way to remember but I don't have one. Thanks for showing this chaos . I could imagine using one without even understanding what you showed and wasting days trying to figure it out without a clue what the issue is.
@seanmahoney1077
@seanmahoney1077 2 жыл бұрын
ByRef means reference to a memory location. That memory location can have many names in your program. All those names mean the same address in memory. That is why changing NameB causes NameA to change. Both reference the same location in memory. ByVal creates a separate memory location for the new nameB and therefore does not affect the value in the memory location NameA. NameA cannot affect NameB either. Essentially they are DIM'd separately.
@TeachExcel
@TeachExcel 2 жыл бұрын
Sean has a very good explanation of the memory pointer setup in his comment. When I am teaching someone this topic, like in my full VBA course, not just a quick KZbin tutorial, I say to make everything ByVal always. In that way, you aren't trying to use one way for a variable here and another way for a variable there - stick to ByVal everywhere and, if you want to change a value in the main macro, use a function that returns a value to do that; this setup will avoid the issue.
@enrikekasijas705
@enrikekasijas705 2 жыл бұрын
Nice. I never knew that part with function not closing itself by default. That's so illogical.
@TeachExcel
@TeachExcel 2 жыл бұрын
I'm glad I could show you this! It's SO easy to forget and then spend hours debugging. :/
@seanmahoney1077
@seanmahoney1077 2 жыл бұрын
EXIT FUNCTION is NOT a good substitute for really crappy programming. Better solution is "IF-ELSE-ENDIF.
@TeachExcel
@TeachExcel 2 жыл бұрын
For sure! It is better to have one way in and one way out. A lot of people do not use this type of structure though, so, hopefully, they can at least use the Exit Function tip to save themselves from debugging hell.
The Best Tips for Recording Macros in Excel
22:18
TeachExcel
Рет қаралды 115 М.
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
Better Worksheet References in VBA for Excel
19:12
TeachExcel
Рет қаралды 10 М.
Excel LAMBDA - HOW & WHEN you Should use it
16:02
Leila Gharani
Рет қаралды 443 М.
8 Tips for Easier Coding in VBA
13:31
TeachExcel
Рет қаралды 10 М.
5 Excel Secrets You'll Be Embarrassed You Didn't Know
17:32
Excel Campus - Jon
Рет қаралды 223 М.
Custom Password Template to Auto-Hide Data in Worksheets
12:53
TeachExcel
Рет қаралды 12 М.
Stop Wasting Time! 3 Easy Ways to Remove Blank Rows in Excel
10:20
Leila Gharani
Рет қаралды 74 М.
Learn Excel MACROS in 10 Minutes Using Real World Examples
9:13
Kenji Explains
Рет қаралды 1,1 МЛН
Excel Time-Savers - 5 Hidden Features for Busy People
14:24
Leila Gharani
Рет қаралды 384 М.
Kill Command in Excel - Is it Dangerous?
14:20
TeachExcel
Рет қаралды 5 М.
Excel Formatting Tricks That Make You Look Like a Pro
12:15
MyOnlineTrainingHub
Рет қаралды 48 М.