[dba-Tech] Excel referencing examples

Susan Harkins ssharkins at gmail.com
Fri Aug 21 11:36:46 CDT 2009


I'm writing about referencing workbooks and worksheets using VBA. As usual, 
the hardest part of the entire article is coming up with realistic examples. 
Right now, I'm stuck with such inventive snippets as

Function ActivateWB(wbname As String)
  'Activate wbname.
  Workbooks(wbname).Activate
End Function

How exciting! ;)

If you'd like to share code that uses any VBA method to reference a workbook 
or worksheet (not charts), I'd be glad to take a look at it. Please send 
short procedures -- just a few lines. Also, needs to be fairly generic. 
After all, the syntax is the article's purpose, not the code's purpose.

As usual, you'll get a bit of fame, as I'll give you credit for the code in 
the article.

Susan H. 




More information about the dba-Tech mailing list