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

Combine Multiple xls workbooks into one

Status
Not open for further replies.

bbrendan

IS-IT--Management
Dec 13, 2001
109
GB
Hi,

Im hoping someone can please help me here!!!

I have a vb app that creates 3 separate xls files. They all reside in the same folder.

For example:

FileA.xls (contains worksheet named :"200")
FileB.xls (contains worksheet named :"400")
FileC.xls (contains worksheet named :"600")

What I would like to do is either create a new xls spreadsheet or use an existing xls document to have each file as a separate worksheet like:

200,400,400

I would like this to happen through vb not excel as the xls spreadsheets are created in vb.

thankyou
Brendan
 
Look at the Worksheets.Add method

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Code:
    xlsApp.Sheets("Sheet1").Copy Before:=xlsApp.Workbooks("Book2").Sheets(1)

This should get you in the right direction.
 
Also, in excel you can always create a Macro of what you want to do and then copy the associate code behind that macro and adapt it into your VB project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top