Selecting Column Until End of Another Array

Joined
Jul 6, 2008
Messages
4
Reaction score
0
Hi all,

I'm importing data from an access database into a spreadsheet. Every time I refresh the data it has the potential to vary in number of entries/length. One field (active doctors) will ALWAYS be filled in but some of the other fields may have blank entries (malpractice insurance). I've selected the active doctors by selecting until there is a blank cell and put it into an array:

Dim DocListName As Variant

' Selects active practitioner list with last name, first name, and title
Range("B2").Select
DocListName = Range(Selection, Selection.End(xlDown)).Value

But then I need to select the same number of malpractice insurance entries as the active doctors without stopping at blank cells. The code I have now is similar to above and is as follows:

Dim MalPrac As Variant

' Selects malpractice insurance list
Range("N2").Select
MalPrac = Range(Selection, Selection.End(xlDown)).Value

However, if there are blank entries, it stops at those cells and doesn't fill the array to the same length as the active doctors array.

Thanks for all your help,

Giraffe3289
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top