: Is it possible to programmatically create a Range, for use
: in database functions, from two non-continuous groups of
: cells (or sub-ranges if you will)?
:
: The catch is that I don't want to create the range in my
: workbook, I just need it to exist in memory so I can pass
: it through the built-in Excel database functionality.
You can dim a variable as a Range and use all the
properties and methods available for a range object. Type
the following, place your cursor inside the word "Range",
press the F1 key and select "Range Collection" under the See
Also link. The information you need is probably under the
Union section.
Dim rngMyRange As Range