Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO and Multiple Worksheets

Status
Not open for further replies.

WOTRAC

MIS
Nov 22, 2002
36
GB
Can anyone give me a kick start on this one, as I need a bit of help.
I have a recordset which may contain anywhere from 3 to 6 records. I want each record to be placed in a seperate worksheet in the same workbook.

I know how to get the data from the database, but exactly how do I loop through the worksheets, at the same time as looping through the recordset.
 
And what have you so far ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi,

You could use the Sheet Index
Code:
i = 1
Do While ...
  ....
  
  Sheets(i).MyRange([i]n[/i]) = rst!Field[i]n[/i]
  i = i + 1
Loop


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top