H
Henninger5
My head is spinning. I have experience using VBA is a Word 2003 Doc
to retrieve a recordset from an Excel Spreadsheet and populate a
userform Listbox. However, now I want to use the VBA behind a
workbook to retrieve records from one of the sheets of the workbook to
populate a Listbox. To be specific:
- The worksheet has 20 columns of data.
- I want a recordset of the first three columns (do I refer to them by
the column letters, i.e. A,B,C, or by the column headers, i.e. first
row entry?) with the blank entries filtered out.
- I want to populate the Listbox with entries indexed the same as the
row numbers from the worksheet.
My natural inclination is to use SQL to open a recordset. However I
only know of the Jet engine that accesses a closed workbook. Can I
use it to query the workbook that's calling it? (everytime I've tried
to use Jet to query an open workbook in the past, i get funky
results). Should I even be trying to use a recordset? Is a
QueryTable better?
Please, I would appreciate someone leading me in the right direction.
Thank you.
to retrieve a recordset from an Excel Spreadsheet and populate a
userform Listbox. However, now I want to use the VBA behind a
workbook to retrieve records from one of the sheets of the workbook to
populate a Listbox. To be specific:
- The worksheet has 20 columns of data.
- I want a recordset of the first three columns (do I refer to them by
the column letters, i.e. A,B,C, or by the column headers, i.e. first
row entry?) with the blank entries filtered out.
- I want to populate the Listbox with entries indexed the same as the
row numbers from the worksheet.
My natural inclination is to use SQL to open a recordset. However I
only know of the Jet engine that accesses a closed workbook. Can I
use it to query the workbook that's calling it? (everytime I've tried
to use Jet to query an open workbook in the past, i get funky
results). Should I even be trying to use a recordset? Is a
QueryTable better?
Please, I would appreciate someone leading me in the right direction.
Thank you.