Wednesday, October 27, 2010

Visual Basic For Applications - Microsoft Excel Specific

What is this VBA stuff, anyway?
  • A real programming language with a few, usually forgettable, distinctions from standalone Visual Basic.
    • And one important one: The program is embedded 'under' the spreadsheet and can not be run outside of Excel
  • A way to write windows code without having to think about "APIs" and "Threads" and such
    • Unfortunately, not fully standardized across Word, Excel, PowerPoint and Access. But the basics are the same.
  • A way to use Excel as a formatting and layout tool so that coding effort is expended on getting getting the job done, not building the graphical user interface.
Do's and Dont's
Do's
  • Do use the WITH statement (execution speed)
  • Do use Option Explict
  • Do use array and where appropriate custom strucutre typs
  • Do learn and use Application Funcitons.
Dont's
  • Do Not use the cells as variables (really slow)
  • Do Not get caught with signed/unsigned variable issues.
  • Do Not fail to make a clean user interface your first priority
  • Do Not write routines other people have done before!

No comments:

Post a Comment