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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overflow from One sheet to another sheet in same workbook ?

Status
Not open for further replies.

Recce

Programmer
Joined
Aug 28, 2002
Messages
425
Location
ZA
Hi

How do I get my data to oveflow from Sheet1 to Shet2 to Sheet3 etc when I export data from any query application i.e. Access. I other words, I would like the data to continue on the next page and then to the 3rd page until everything is exported. :->

Thanks
 
It can be done but why ???
That amount of data in excel, in that kinda format will
a: make the size of the file massive
b: make any formaulae ridiculously complex

I would very much caution against exporting that kinda length of data to excel. Can it not be worked on in Access ?? Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Hey Geoff

What can I say. Users have weird requests. I think they must be more comfortable with Excell :->

 
Something like this'd probably work - posted by Chance1234 a while ago:
Sub Imverymad

Dim Mydb as database
Dim Myrec as recordset
Dim Wrkbk as workbook
Dim IntSht as integer
Dim RwCnt as integer
Set Wrkbk = createobject("excel.application")

Set Mydb = currentdb()
set Myrec = mydb.openrecordset("YourTable")

intSht = 1
rwcnt = 1

Do until Myrec.eof = true

if rwcnt = 65000 then
rwcnt = 1
intsht = intsht + 1
end if

with wrkbk.sheets(i)
.cells(rwcnt,1) = myrec![ID]
.Cells(rwcnt,2) = myrec![telephone Number]
end with

rwcnbt rwcnt +1

myrec.movenext
loop

I'm sure someone like Robbroekhuis has also posted a coupla routines for this kinda stuff Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Thanks for this Geoff

I'll play around with this :->

Regards



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top