Unable to export recordset data to multiple excel range in same sheet

jay9324

New member
Local time
Today, 14:46
Joined
Feb 12, 2015
Messages
8
Dear Friends,

With below codes I am able to export recordset data to specified excel range
if recordset count is 25. But I am unable to export the data greater than 25 to 2 specified range.

Please Help me guys.. I am stuck in this from last 10 days.

Regards,
JK
 

Attachments

you code does not match the result - code starts from row 16, example from 2, code opens IN_25, example is IN_82 so I'm not clear where everything starts and finishes

But assuming your specified range is below the first range and you are just skipping a row, you need to increment the value of I by 1 if I=25 to skip row 25

so add this row after the I = I + 1 row

if i=25 then I=I+1

due to the confusion between code and example, it may be that 25 needs to be something else
 
try rstData.Movelast and then a rstData.MoveFirst before your rstData.eof?
 
Hi CJ_London,

I = 16 is the row number from which data will start pasting in excel sheet. So Example my recordset returning 78 records then:

A16: J59: first 25 records
A70: J107: another 25 records

so on.

This is what I want. Please help..!!!!
 
This is what I want. Please help..!!!!
I've provided the solution, please read my post and tell me why it doesn't work
 
Thanks CJ_London,

25 is a Excel sheet name and i = 16 is data print will start from 16th row of excel column.
 
Hi CJ,

Can you tell how to export to excel and while exporting skip few rows in between.
 
see my post #2 - modify the code to meet your requirements

if i=25 then I=I+1

change the 25 to the relevant row number, and +1 to +2 or whatever number of rows you want to skip

if you want to repeat this for say rows 50, 75 etc then investigate using the mod function
 

Users who are viewing this thread

Back
Top Bottom