excel-vba

136 expert-verified Q&A posts in this category, sourced from the top-voted answers on Stack Overflow.

Solved March 18, 2011

Compiler Error: User-defined types not defined

I get the compile-time error "User-defined types not defined" on this line: Dim cn As ADODB.Connection` What could be wrong? Code: Sub test() Dim…

thumb_up 19 trending_up 11
Solved January 7, 2011

Excel VBA: Alternate Row Colors in Range

I spent a VERY long time today looking up a method to alternate row colors within a specified range. There really isn't a lot…

thumb_up 7 trending_up 6
Solved November 30, 2010

Architecture of an Excel application

after 10 years of programming I find myself with the daunting task of creating my first Excel application in Excel 2007. I have programmed…

thumb_up 5 trending_up 9
Solved November 17, 2010

Excel-VBA: Variable declaration necessary?

Would it be wrong if write the following code Sub Something() Dim i As integer Dim xRange As Range Dim yRange As Range Set…

thumb_up 12 trending_up 2
Solved September 8, 2010

VBA inheritance, analog of super

For example I have class A which implements class B ---class A---- implements B public sub B_do() end sub --class B---- public sub do()…

thumb_up 16 trending_up 8
Solved June 30, 2010

How to Insert Double or Single Quotes

I have a long list of names that I need to have quotes around (it can be double or single quotes) and I have…

thumb_up 21 trending_up 10