Excel is a mighty powerful tool & learning it can be overwhelming.
However, in my experience the best way to learn Excel VBA is by simply using it. Basic idea of programming languages though will be an added advantage.
Here are a few pointers to have a better understanding of VBA.
- Try & record simple macros: A good starting point is to record some simple macros. These will show you how to do many things such as selecting ranges, copy pasting, switching sheets, changing values, etc. These simple building blocks usually go a long way when building macros. Once you have recorded the macro, go look at the code and scruntise it.
- Google is your friend!: After creating some macros based on your recording knowledge, you’ll have significant gaps. Start googling to see how you can fill these. VBA is very well documented on various excel blogs, so for 99.99% of problems you’ll throw at it, google will find a solution.
- Excel is Smart: If you are like me, you won’t use VBA all the time. So this means you’ll often write something, then forget about it, and then end up writing it again 2 months later. After a while you start googling things you’ve already googled. At this point, I usually default to ‘experimenting’. For example if I want to paste a selection of values I would write ‘Selection.’, and the VBA editor will show me what I can complete it with. As I start to write ‘Selection.Pa’ it will show me Paste and PasteSpecial, I select the later and then it will show me among others, the option of xlPasteValues, which sounds like what I need. VBA is very verbose, and you can use it to your advantage by just building your expressions based on what suggestions the editor gives.
