How to insert a row into Excel Sheet?

I

Ivan Abramov

Hello.

I'm writing a code in VB6 that creates a reports in Excel by templates
(Excel files).
In one case I need to insert as many rows as there are records in db table
(as a rool a couple).
But the problem is there are static texts and other bookmarks below the place.
How can I insert a row(s) into the special place of Excel Sheet (where my
bookmark is) so that all the content below the place is going down?
(by object model of Microsoft Excel 12 Object Library).

Thanks in advance.
 
A

Andrew

worksheets("Sheet1").rows("4:7").insert
assuming you know where you want to start the insert and you know how
many records you want to add.

Cheers,
Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top