I'm confident coding in C# & Java, but have never gotten around to writing macro's in Excel.

I was wondering if anyone could point me in the right direction for some NON-beginner cheat sheets for coding excel macros?

I guess i am looking for things like syntax guide, commonly used functions, best practices. The more concise the better!

David

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

Well, for a start, I think a generic VB syntax sheet would be useful. After all VBA is just a stripped down Visual Basic (more similar to VB6 than VB.NET, so no LINQ queries on your cells!) with the Office object model. I really like this C# to/from VB.NET sheet. And since people rarely use VBA to develop complex classes, once you're familiar with the basics (subs, variables, loops, branching) it's pretty much standard programming from then on.

As for the object model, if you're familiar with the .NET documentation, you'll find that the VBA/excel help is structured similarly (with lists of methods and properties for each object). Things usually start to go smoothly once you're familiar with the essential objects:

  • Excel.Application
  • Excel.Workbook
  • Excel.Worksheet
  • Excel.Range

I've looked for a few visually structured documents, like this, this and that (caution: from old excel version), but they appear very mildly useful. There may be some gems out there, but problem-specific google searches usually works pretty well.

link|improve this answer
thanks for the links at the bottom, they were useful, – GreyCloud Jan 30 at 14:24
i'd still be interested in a syntax guide to VBA though – GreyCloud Jan 30 at 14:25
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.