vbScript in Excel - How to start learning ?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieAnalyst Assistant Commented:
Do you mean VBS (Visual Basic Scripting) or VBA (Visual Basic for Applications)?

With VBS you would write and run the code outside Excel, whereas with VBA it's the opposite.
Hi ,

If you mean on how to write a macro, just start recording a macro, and see what you do it in macro editor.

Hope this help you.
Happy N.Y.
zmauAuthor Commented:
Sorry for the late answer.
I mean Visual Basic for Applications.
I know that I could start by recording a macro. But yesterday I've posted a question and got a nice answer (which worked), only I did not understand most of it.....

I think the best way is by doing what you're doing.  Peruse these boards, find users who seem to really know what they're doing (like zorvek, rorya, matthewspatrick ... heck, all the people over on the right) and follow them.  When you find code that you don't understand, don't hesitate to ask questions.  Also, you need to add breakpoints to the code (via F9 key) and step through the code (via F8) and watch what it does.  If they use variables, then add those in your watchlist.  Recording macros is a good idea.  I keep a text file where I copy / paste code that I want to remember.  I've even started a folder where I'm keeping little self-contained routines that I might need to refer to later.

Recognize that it's going to take time.  Most of the people on here (especially the really good ones) have been doing this for >10 years.  You're not going to learn it in 3 months.  I've been doing coding in Access and Excel since 1994.  

Good luck in your pursuits.  The willingness to dig in and figure it out is key ... so try to cultivate that!

Patrick MatthewsCommented:
I got my start by turning on the macro recorder, doing stuff, and then reviewing the code that the macro recorder generated.  It's a pretty effective way to get started, although it can cause one to develop bad habits (such as using too many Range(...).Select statements).

Unfortunately, the Excel VBA help files have seemed to have become less useful the last few versions, which is a pity.  I thought that the help file for 2000 was excellent, and for 2003 very good.  I am less sanguine about the 2007 and 2010 Excel VBA help files.  Even so, the help file is still useful.

Like sdwalker, I highly recommend using resources such as Experts Exchange.  Follow the activity of Experts who seem to know where there towels are (I am flattered that sdwalker included me on that list!), and ask questions when you get stuck, or just need to understand something a little better.  If you ask a question, and get back an answer that works but which you do not understand, insist that the Expert explain it better before you give a grade.

As you start feeling more comfortable, you should try answering questions yourself.  I have learned more in the course of trying to answer other people's questions than I have through any other source.

There are several Excel blogs I recommend following.  Many are worthwhile; these are my favorites:

If you are on Twitter, consider following these accounts for Excel:
matthews_p (yes, that's me engaging in shameless self-promotion)

As for books, I would recommend John Walkenbach's "Excel XXXX Power Programming with VBA", updated for each version of Excel, and "Professional Excel Development" by Rob Bovey, Dennis Wallentin, Stephen Bullen and John Green.  If you ever end up trying to programmatically manipulate the Ribbon, then I recommend "RibbonX" by Robert Martin, Ken Puls and Teresa Hennig.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.