Hey needforvba,
The way to get hands-on experience is to come up with problems to solve and then to solve them. If you take a course or buy a book, it will include lessons as well as suggest problems for you to tackle.
With an interest in problem-solving, as Narayan says, you come to see all the things you can achieve in an area of interest, and you will start to have more and more ideas for personal and work projects. I'll add the adjectives "creative", "detailed", "passionate" (good for any pursuit), and "curious" as motivating factors in becoming a skilled programmer. Obvious from this post is your passion and curiosity.
Computers were invented as tools to make our lives easier and to raise our day-to-day achievements in various pursuits to a level that ordinary human resources would not be able to achieve. Computers do nothing until programmed, so it is the programmer's task to find ways to make lives easier, and to increase productivity, achieving things that would otherwise be impossible or impractical, including the more modest sounding goal of just achieving a nicer result than one could achieve without the programmer's labors. A good programmer has many skills, including efficiency expert, aesthetic sensibility, inventive ability to think outside the box, empathetic ability to put themselves in the mind and shoes of the end user so the program is intuitive and best serves the user's needs (the biggest complaints from users have to do with the difficulty in using program interfaces and with them not best suiting their needs), and finally, they have to know or to learn a lot about every subject or business that their programs will be designed to serve.
Lesson number one -- anything is possible (although the solutions to various problems vary in the practicality of their solutions).
~~~
I think you had a great idea to ask for a lesson in various ways to do a particular task, That is a great exercise. Even though sometimes one method or another is best suited for a specific task, this will help you to understand how the various methods relate to each other and hone these tools in your programmer's toolbox. You'll have some experience to help you decide which one to use next time, as well as with how to use it.
~~~
Besides books and classes, which are great, because you have a mentor/guide/teacher to help you learn the concepts and techniques in an efficient way, there is also the method of joining multiple forums, where you can ask for mini lessons and help with specific problems, and (this is also a great teacher) help answer other people's questions and problems; the method of finding online resources and trying to find the solutions to your problems yourself; the method of learning to use the built-in help system to your advantage; the method of learning the basics of how to use the debugging tools in VBA to track down the reasons your code is not working the way you'd like.
A Google search for "VBA lessons" brings up a plethora of websites with free instruction materials. I have no experience with them to make any recommendations, but that's surely a good place to get your feet wet.
~~~~~
A general tip I highly recommend is putting the statement "
" at the top of every code module (before all the procedures). It requires you to declare all variables before using them, which is the "right" way to program

... VBA is unusual among programming languages in that by default it will create variables on-the-fly as soon as it runs into a statement in your code that appears to rely on a variable name that doesn't yet exist. The biggest problem with that style of programming is that it is very difficult to debug, because VBA will not warn you if you have a typo in a variable name. It's good practice for other reasons too.
Good luck! Keep asking questions and I'm sure you'll enjoy learning to program and having the satisfaction of making your computer do things computers have never done before--at least in your particular way.
Asa