5 Killer Excel VBA Tips Everyone Should Know

Поділитися
Вставка
  • Опубліковано 27 лип 2024

КОМЕНТАРІ • 112

  • @sdawilson
    @sdawilson 4 роки тому +31

    It's embarrassing. I've been coding in VBA for 20+ years, mostly in Access. I learn new things every time I watch one of Paul's videos. Thoughtful, structured, articulate and clearly demonstrated... the best on UA-cam.

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому

      Great to hear! Thanks Simon.

    • @MGE0007
      @MGE0007 3 роки тому +2

      ....there is nothing embarrassing about seeking knowledge.....🤔

    • @kairomalachi255
      @kairomalachi255 2 роки тому

      You all probably dont care at all but does anybody know of a tool to get back into an instagram account?
      I was stupid lost my account password. I would love any assistance you can give me

  • @danielp1569
    @danielp1569 4 роки тому +5

    Thank you Paul for the generosity in sharing your experience!

  • @mcallister7593
    @mcallister7593 3 роки тому +1

    This whole series is just brilliant and I am very grateful I found it. Bravo and thank you.

  • @Vandalfoe
    @Vandalfoe 4 роки тому +8

    Great video as always. One thing for viewers of tip #5 to note is that MyMsgBox, as you've posted it, has a hardcoded message. However, it was written to accept any string for message text, by replacing the "... Option B..." hardcoded text with the variable 'prompt', which I see is the first (and only required) parameter to MyMsgBox.

  • @jmstampe
    @jmstampe 4 роки тому

    That’s good stuff especially the compiling shortcut; something I find I have to do frequently in my line of work.

  • @OmkarUmbre
    @OmkarUmbre 4 роки тому

    I am working on VBA coding for more than 11 years. But when I watch your videos, I think there are lots of things which still I need to learn and use them. Great videos. Thanks.

  • @jacksonmacd
    @jacksonmacd 4 роки тому +3

    I've always been aware of conditional compilation, but never pulled the trigger to try using it. Tip#5 gives me inspiration. Thanks. I really appreciate your clear and concise teaching methods.
    Btw, perhaps a separate video all about conditional compilation could be interesting.

  • @edge5817
    @edge5817 4 роки тому +2

    Thanks Paul for this wonderful tips... very useful indeed!

  • @Ganesh749
    @Ganesh749 4 роки тому +13

    Great as always.. Paul
    Thank you for sharing wonderful tips.. Indeed you are VBA guru!!

  • @free3690
    @free3690 2 роки тому

    Thank you for awesome tips. I am going to try the F3 search!

  • @OzScout66
    @OzScout66 4 роки тому +2

    Mate, I've learnt more xl vba tips and tricks from you in the past month, than I have in the past 10 years. You are truly a "VBA Master" my friend - Thanks & Cheers from your friends Down Under in Oz :)

  • @JHatLpool
    @JHatLpool 3 роки тому

    Really good. Thanks. If only I knew all of this 5 years ago !

  • @JohnOvens
    @JohnOvens 4 роки тому

    Hi Paul, this is a fantastic video. You keep adding helpful hints based on your extensive experience. Thanks

  • @justintime5021
    @justintime5021 2 роки тому

    # 3 was very useful. Thanks for that! I normally always googled that and copied the syntax as well

  • @scottpinkham330
    @scottpinkham330 4 роки тому

    Great tips - thank you for this

  • @sindhusudhakaran1731
    @sindhusudhakaran1731 3 роки тому

    very useful and not commonly known!! Thank you

  • @frikduplessis3869
    @frikduplessis3869 4 роки тому

    Compliments for the new year Paul, great tips as always

  • @sandeepkothari5000
    @sandeepkothari5000 4 роки тому

    Paul, these are really killer tips. What a way to usher in the new year! Have a happy one.

  • @BenjaminHouot
    @BenjaminHouot 4 роки тому +1

    Hi, Good tips. thanks for sharing.
    I use Ctrl+Tab to switch between workbook.
    You could also use Shift to loop in the reverse order.

  • @rajeshkumargoyal6528
    @rajeshkumargoyal6528 3 роки тому

    Thank you. You are real VBA guru.

  • @mike_case
    @mike_case 4 роки тому

    Great work again, especially #5 :) Thank you Paul your work is really helpful. I'm waiting for next tips ;)

  • @iincitr
    @iincitr 4 роки тому +1

    Thank you Paul. Tip #5 is very useful that I didn’t know. Would you pls make a video about Excel interoop operations.

  • @joaocustodio2094
    @joaocustodio2094 2 роки тому

    Another great video. Thanks Paul.

  • @tuworlds
    @tuworlds Рік тому

    another great video thank you

  • @wayneedmondson1065
    @wayneedmondson1065 4 роки тому +1

    Hi Paul.. great tips.. thanks for starting off 2020 with this useful video. Looking forward to more VBA fun with you and Excel Macro Mastery in 2020. Happy New Year.. and Thumbs up!

  • @obsoquasi
    @obsoquasi 4 роки тому

    thank you very much for these useful tipps!

  • @warrenhall1750
    @warrenhall1750 3 роки тому

    That was great.

  • @tuyoexcelypowerbi
    @tuyoexcelypowerbi 4 роки тому +5

    Very useful. Best of last VBA tutorials I have watched lately!!

  • @juliogadiolisoares3157
    @juliogadiolisoares3157 2 роки тому

    🤔👏👍 very useful thank you

  • @vbatipsandtricks5237
    @vbatipsandtricks5237 4 роки тому

    Good way to share.

  • @Planet_Xplorer
    @Planet_Xplorer 3 роки тому

    I use 'stop' command for debugging. Very useful

  • @nicor1501
    @nicor1501 4 роки тому +1

    Tip#5 is indeed my favorite too :-)

  • @JithinDevan
    @JithinDevan 4 роки тому

    Thank you Paul for this video...
    Could you make a video on how to export/save embedded objects from an Excel file? I've tried changing the Excel extension to .zip but it did not work.

  • @scotolivera8207
    @scotolivera8207 4 роки тому

    As usual great content and very useful, if there is anyone can explain and give a practical example of how classes work in real life and in which circumstances could be useful that person would be you . So i ll really appreciate if you could take time and make a video about this topic.🙏

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому

      Check this video out: ua-cam.com/video/ie2Duci-qKQ/v-deo.html

  • @markwoodward7016
    @markwoodward7016 4 роки тому

    Hi Paul, I'm really loving your videos. Does the Excel VBA Handbook Course cover everything you present? I would love to have all this information in one place.

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому

      Hi Mark.
      The purpose of the Excel VBA Handbook course is to teache how to build Excel VBA applications from scratch. So it does include many tips but it doesn't include everything on this channel.

  • @BertandRussell
    @BertandRussell 4 роки тому

    Hi sir,
    I am the first one to like n comment on this video.
    God bless you

  • @RichardCookerly
    @RichardCookerly 4 роки тому

    Amazing video as always! It’s pretty incredible that I still learn something new with each video even though I’ve been working with VBA for 8 years. Keep up the great work!

  • @walerij
    @walerij 4 роки тому +1

    What does the # sign mean before the IF?

  • @thearchibaldtuttle
    @thearchibaldtuttle 4 роки тому +1

    Happy 2020!

  • @aiooshhaw9640
    @aiooshhaw9640 4 роки тому

    Hi Pual , thanks for your videos its really helpful for us, I wanna to ask you about some problems that i faced when i used VBA, how I can contact with you > thanx

  • @psychedelarte7257
    @psychedelarte7257 4 роки тому

    Merci

  • @lyonhard1
    @lyonhard1 4 роки тому

    Cool beans Paul

  • @aNDy-qh1em
    @aNDy-qh1em 4 роки тому

    Hi Paul, i have got a big app >15MB with dozens of modules, forms, class modules. I have applied all the options you proposed to reduce it. Still it is too big. Is there any way to upload modules dynamically? - this definitely should help. Thanks.

  • @FizzyMcPhysics
    @FizzyMcPhysics 3 роки тому +1

    Wow! Some wild stuff buried in the settings. I'll have to remember to press Ctrl F3, instead of Ctrl F Haha.
    I've recently devised a different way to handle breaking and msgbox suppression using a DebugMode Global variable which I can toggle on and off with a button in the worksheet, or by setting it in the Immediate window. For me, this has the advantage of being built into the code that I import, so I don't have to set up the work workbook the way you did.

  • @songokussj4cz
    @songokussj4cz 3 роки тому +1

    For those Conditional Compilation Arguments, I'm doing EarlyBinding/LateBunding checks for the case end user does not have a reference to for example Microsoft.Scripting for Dictionary. Example: Production Arguments: none. Debugging arguments: 'EarlyBinding=1'
    #If EarlyBinding Then
    Dim myDict as Scripting.Dictionary
    Set myDict = New Scripting.Dictionary
    #Else
    Dim myDict as Object
    Set MyDict = CreateObject("Scripting.Dictionary")
    #End If
    Now when EarlyBinding=1, I can have myDict. hinting. But when I delete EarlyBinding, it goes to LateBinding which works the same (little bit slower) but User doesn't have to have those references problems

  • @christianmuntean
    @christianmuntean 4 роки тому

    I need a answer to this. Is it basically possible to somehow connect excel to a gameserver. I mean so the data exchange would be really fast. If this is possible then online Excel games should not be a problem anymore.

  • @nelsonrioux5555
    @nelsonrioux5555 4 роки тому +2

    Thank you for the tips and for letting me discover "Events". By the way I don't know why you have put an "#" before IF and END IF

    • @aNDy-qh1em
      @aNDy-qh1em 4 роки тому +1

      Hello, here is some explanation stackoverflow.com/questions/6325486/if-else-end-if-what-do-the-hash-signs-mean-in-vba
      C'est facile

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +3

      These #if statements are used by the preprocessor to check if code is to be used or not. Vba checks the code before it runs. If the condition is false then the code is ignored. Even if the code has an error it won't matter because the code is ignored.

    • @terrylavelle1139
      @terrylavelle1139 4 роки тому

      @@Excelmacromastery Love your work, Paul. Is it worth expanding on these in a future video?

  • @barrygeldham390
    @barrygeldham390 4 роки тому

    I didn't know about searching with F3 and a quick test shows that I can use it in reverse to search backwards using Shift-F3

  • @GanovAlex
    @GanovAlex 3 роки тому

    thanks a lot, your channel is on top of my videos, F3 and goto new Paul's video :-) You're using MZ-tool, that's great one, for me i can't imagine now how to work without it, very comfortable and useful add-on

  • @feynmanwasagenius3482
    @feynmanwasagenius3482 4 роки тому +3

    Hmm the last one is interesting, what I normally do is import a module called testmsg and call that while I am testing the code. The I remove the module at the end and remove or silence the calls to the module. Interesting different method

  • @MrWarlls
    @MrWarlls 4 роки тому +1

    I didn't know the tip 5. I used a global constant to do the same think. But your method is clearly better. Is it possible to set several parameters ?

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +2

      You can have multiple compilation arguments. They are seperated by the colon symbol

  • @eltee704
    @eltee704 4 роки тому

    thanks Paul, do you host your repository anywhere? i'd love to be able to go through the modules for best practices and have some easily set up macros that i may not have thought of

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому

      Hi Lee, I don't host at this time but I do have a 50+ Excel VBA templates. I normally give these away as a special bonus with the Excel VBA Handbook course during live webinars. There will be a live one in the next week or two.

    • @eltee704
      @eltee704 4 роки тому

      @@Excelmacromastery thanks for the reply ❤️

  • @slbrick56
    @slbrick56 4 роки тому

    Just a quick comment ... during the explanation of Tip 4 (turning off error handling) the final display shows that the error stops within a loop that starts with the index value i=2. The error catches when i=3. The narrator indicates that the error occurred on the 3rd iteration thru the loop. But that is not correct. Since the loop began with i=2 and the error occurred when i=3, this is the 2nd iteration of the loop. A very small error in a great instructional video.

  • @shakhobiddinnakiev6767
    @shakhobiddinnakiev6767 Рік тому

    #3 is tip?))

  • @szisziszilvi
    @szisziszilvi 3 роки тому

    Hi, i see there are #s in the code at some points, like somewhere at 9:48 before some commands in this video. What are they? I've never seen them and google won't find it for me.

    • @Excelmacromastery
      @Excelmacromastery  3 роки тому +2

      They are Conditional Compilation Arguments. See my video on Debug.Assert for more information.

    • @szisziszilvi
      @szisziszilvi 3 роки тому

      @@Excelmacromastery I'll check for sure!

  • @bogdanexit1
    @bogdanexit1 4 роки тому +1

    Hello Paul. You can't make a video in the future to share a opinion for the fastest way tu sumifS not sumif? . I have to sumifs by 5 condition. From sheets that have 200000 - 500000 rows And my last time the code takes 2 hour to run. I search over the internet and the maxim I found is Sumif not sumifS Thanks.

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +2

      I'm sure you meant "Can you make a video?". It's not in my schedule for the near future but who knows:-)

    • @bogdanexit1
      @bogdanexit1 4 роки тому

      @@Excelmacromastery You are right (for can't). Thank you :)

    • @christianhapke9384
      @christianhapke9384 4 роки тому +2

      Read the sheet data into an array. Loop threw array and if all x conditions are fulfilled, you add the value you want to sum into a dictionary. This should take a couple of seconds.

    • @bogdanexit1
      @bogdanexit1 4 роки тому +1

      @@christianhapke9384 Thank you.

  • @JstnW
    @JstnW 4 роки тому +1

    I don't wanna kill anybody, but I'll try your tips.

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +1

      Please don't (lol). Thanks Justin

    • @JstnW
      @JstnW 4 роки тому

      Excel Macro Mastery lol. Ok I was over the top. Sorry

  • @rrrprogram8667
    @rrrprogram8667 4 роки тому

    If u wanna be 2nd in vba then follow this channel..... (1st is always paul)

  • @ricos1497
    @ricos1497 4 роки тому +1

    The last one I didn't know about. I'm trying desperately to think of a situation where I'd use it. I suppose it could be used when moving a workbook from live to test environment or something?

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +1

      It's more for a development environment. Test should match Live as much as possible.

    • @ricos1497
      @ricos1497 4 роки тому +2

      @@Excelmacromastery sorry, yes, that's what I meant.

    • @jimfitch
      @jimfitch 4 роки тому +2

      Another possible use of Tip 5 could be this: I write procedures & functions with intent to display message boxes in some operational settings, but not others. For example, a procedure executes commands & displays a MsgBox that announces completion to the user. In a different application, that procedure is one of several called by a higher level procedure, so I don’t display the MsgBox at the end of each called procedure (because that interrupts execution until the user dismisses the MsgBox), but I display the MsgBox when the higher level procedure completes. The way I have handled that is to write the lower/called procedure with a parameter that controls display of the completion MsgBox. When executing as standalone, the argument fed to the parameter displays the MsgBox. When called from a higher procedure, the calling procedure supplies the argument that suppresses the MsgBox. It works, but has always felt a bit clunky & requires careful attention to detail. Perhaps Tip 5 would be an easier/better way to control this.

  • @robertschrock1506
    @robertschrock1506 4 роки тому

    U

  • @kytan13
    @kytan13 4 роки тому

    This might be a stupid question, but what´s the shortcut to delete an entire row?

  • @dgh25
    @dgh25 4 роки тому +1

    Nice but nothing new. I would like to know how you delete an entire line of code in one click though?

    • @Excelmacromastery
      @Excelmacromastery  4 роки тому +5

      Ctrl + Y

    • @dgh25
      @dgh25 4 роки тому

      Thx! (And OMG! Thats why my code disappears when I use CTRL + Z and CTRL + Y for undo and undo undo - like in Office apps) 👍

  • @erodimon
    @erodimon 4 роки тому

    VBA is a zombie language, so let's just don't use it. And help it to die.

    • @houstonvanhoy7767
      @houstonvanhoy7767 3 роки тому +1

      I read this statement yesterday: "If VBA is dead, then it is the most productive corpse in the office."