Sunday, September 7, 2008

The Mandatory Basics

The maiden post of almost every blog seems to require a mandatory blurb with a similar introductory tone. If you are after a break from convention, you are about to be disappointed.

I am a marketing/psychology researcher who happens to know a bit about Microsoft Excel, the Glorified Calculator; and its companion event-driven programming language, Visual Basic for Applications (VBA).

(I will not even attempt to explain what "Event-driven programming" is. The Wikipedia link should be sufficient explanation for now; and in the greater scheme of things, these technical definitions are not too important. I'm sure your Reviewer won't ask what a Call Procedure is - if they do, give them my number, I want to get sloshed with them.)

During the last six or so years (3.5 of which masquerading as a marketing doctoral candidate), Excel VBA has saved me countless hours in data collection and coding. In fact, given that my studies always involved manipulation, randomisation and counter-balancing, I couldn't have done it without some form of automatic assistance. Guess I could have hired 20 research assistants to help counter-balance my stimulus material, but then I'd be more broke than I already am now.

Enough spruiking; here are a few preambles that might help you decide whether this blog is for you, or whether another Youtube video will be more interesting:
  • I'm far from an expert in the art of VBA programming. Therefore this blog will not be a definitive guide to your programming problems - it's not intended to be. This blog will specifically focus on how VBA can help you do sound experimental/survey research. Therefore, every idea here will be driven by research principles; technical sophistication comes second.
  • Since this is not intended to be a comprehensive VBA guide, I may introduce concepts that have not been covered elsewhere in the blog. For instance, I won't give a detailed explanation of what objects, procedures and methods are. Punch "Excel VBA basics" into Google, or get a VBA for Dummies book, they will give you much better explanations - but they won't be as research-focused as you'd like them to be.
  • Technical standards. Every time I refer to codes, I will write in fixed-length font:

    Sub ThisIsATestCode ()
    Sheets("sheet1").Visible = True
    Msgbox "hello!"
    End Sub

    Examples used here will refer to Excel 2007. There are some VBA commands in Excel 2007 that are not available for 2003; I will avoid using them; or if absolutely necessary, give you codes for both versions. People say Excel 2007 has a painful interface with its Ribbon and crap...I find its VBA changes even more annoying.

    Still with me? Good. Hopefully we can all move forward and do some good for the world. Failing that, a JCR will do.

    Stay a step ahead,
    Alex.

    No comments: