Alex Rivera | Logout

How to get started with Visual Basic for Applications?

Asked 2010-10-26T05:04:49.723
39

I'm a little intimidated by the wealth of knowledge displayed on the front page of this website, but it gives me hope that I'm talking to the right people. I had a pretty rotten experience with one of our programmers today, and I'm hoping that you might be able to offer some advice.

I'm an office admin (primarily clerical), and one of our macros in Microsoft Excel broke today (I apologize if that description makes me sound like a "dumb user"). Our manager called our IT department and they sent up 2 programmers. The first guy was nice and asked if I'd be interested in watching him fix the problem -- but the 2nd guy spoke up and said "She's just clerical, she'll never get it."

Yeah, it hurt -- but to make a long story short, I asked my husband (who is a "perl" programmer) what I could do to show these guys what I'm made of, and he recommended something called "VBA" because I work with Microsoft Office a lot. He wasn't quite sure if "VBA" was right, so he recommended I get involved with the community at this website (he says he finds a lot of answers to questions here).

I've researched "VBA" on google, but there are literally THOUSANDS of results. I just want to be able to record and edit macros for Microsoft Office products, and possibly get good enough to show that programmer I'm not just a "stupid female admin". Can any of you pro's please give me your advice on the following items?

  1. Is "VBA" actually what I'm looking for to create Macros and automation?
  2. If not "VBA", what is a more suitable starting point?
  3. A good book or website with lessons?
  4. Anything else you think would be helpful? Do they offer college classes for things like this?
vba
Edit
Report

2 Answers

8

If you get reasonably proficient with VBA, you won't have to call IT for these matters. That may be against your company's policy, but I'll leave that ethical dilemma to you. If I wanted to learn VBA, I would study these three books in order

VBA for Excel for Dummies (Walkenbach)
Power Programming for Excel VBA (Walkenbach)
Professional Excel Development (Bullen, Bovey, et al)

Concurrent with that study, you need to start solving real-world problems. Go to social.msdn.microsoft.com and start reading the VBA forums. Answer whatever questions you can. The ones you can't, wait for someone else to answer it then reproduce the problem and solution so you know it. Do the same with stackoverflow questions by following the vba tags. If any question seems too complicated, just skip and go to the next one.

Read Excel VBA blogs http://www.dailydoseofexcel.com/dicks-blogroll/ Start with http://datapigtechnologies.com/blog/ and http://blog.contextures.com/ for sure. They're not just VBA, but they're very well written.

Here's what will happen: In 3-6 months you will have discovered a whole new world. You will have written simple macros for yourself and your coworkers that eliminates some of the drudgery from your day. You'll start looking for wasteful process you can eliminate with simple code. In 6-12 months you will have become reasonably proficient. You won't need IT to fix minor problems for you. You will be the go-to Excel person in your office (learning VBA will make you better at Excel). You will have helped thousands of people here and on the msdn forums all while helping yourself.

After 2 years you'll probably start being recognized by MS and the community as an expert. You'll get sick of answ

answered 2010-10-26T17:18:53.610
3

Excellent question!

VBA stands for Visual Basic for Applications and is the macro / automation tools that comes with Office (the macro that you talk about in your post will be written in VBA).

VBA sounds like a perfect match:

  • VBA is targeted at non-techies and so is designed to be forgiving and easy to pick up.
  • Google contains a wealth of information on the subject, all targeted people in your situation (people without a technical background who simply want to produce an Office macro that helps them)
  • Using Office every day will give you an opportunity to use and practice what you learn.
  • VBA has a fantastic macro recording function which is incredibly useful (especially when you are trying to learn VBA)

Like I said, Google has a wealth of information and introductory articles on the subject (e.g. Getting Started Using VBA, to pick a good looking example). I recommend reading through one of those to get a quick overview and then just have a go and see what you can get it to do:

  • Use the macro recorder! If you can't work out how to do something then just record a macro of you doing it and see if you can figure out how to do it from the code it generates.
  • Give yourself problems to solve.
  • Ask questions here! :-)

Also, many places will offer courses on VBA which I'd definitely recommend - guides on Google will be excellent for showing you the syntax and how to do do certain actions (like how to select a certain cell, or how to do loops), however they won't be as good at teaching the problem solving aspects of programming - for this you really need to learn from a person which is where a course will be very helpful.

As a final note, I would advise against tryin

answered 2010-10-28T03:31:49.737

Your Answer