Hi All
I am very new to VBA and am trying to pull some data into an Excel Spreadsheet from an Access database (both 2002 edition) using a VBA written macro.
My spreadsheet has several rows, of which the first two cells in each row contain a start date and end date respectively. The goal is to import into these rows, several fields from a table in the database where the start and end dates match the ones in the excel worksheet. I have no problems connecting to the database and retrieving matching data for one row.
The real question is how to introduce some level of recursion into the VBA, as the number of rows in the worksheet is variable and I do not want to have to write the same code for each line where I would have to hard code cell references for the two dates.
Please ask if this needs more explanation - any help is appreciated.
Many thanks
Geraint
The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy
I am very new to VBA and am trying to pull some data into an Excel Spreadsheet from an Access database (both 2002 edition) using a VBA written macro.
My spreadsheet has several rows, of which the first two cells in each row contain a start date and end date respectively. The goal is to import into these rows, several fields from a table in the database where the start and end dates match the ones in the excel worksheet. I have no problems connecting to the database and retrieving matching data for one row.
The real question is how to introduce some level of recursion into the VBA, as the number of rows in the worksheet is variable and I do not want to have to write the same code for each line where I would have to hard code cell references for the two dates.
Please ask if this needs more explanation - any help is appreciated.
Many thanks
Geraint
The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy