|There are lots of books and web sites related to learning to write VBA code. While I have never read a book (probably should have) I did spend a lot of time hanging out in forums and looking at what others have written, then using the debugging techniques to help understand what their code was doing, whether I needed that code or not. I'd read a question, see the answer(s) and then "debug" the code if I couldn't understand how it was doing what it was doing.|
e.g. "Oh, that's how you build a comma separated text string from multiple values and then eliminate that pesky final comma!"
Once a specific technique is understood, the concept can usually be applied/expanded to fit other situations. The main thing to keep in mind is that VBA is nothing more than a logical, step-by-step set of instructions. Try recording a macro and see what the VBA editor produces. Granted, it will be inefficient, bloated code because the editor will simply record (just about) every manual step you take, but it will give you something to "debug" just to see how the debugging tools work. Eventually you will learn how to clean up recorded code to make it more efficient, but it's not a bad place to start.
Chip Pearson is probably my #1 on-line go-to resource.
Lots of formulas and VBA to play with.
I understand that John Walkenbach is a well respected author in the Excel world.
I hope that helps.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.