Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 10, 2013 12:54 PM by ilclaudio
Member
6 Points
9 Posts
Jan 07, 2013 09:10 PM|LINK
Hi all,
I have huge Excel files containing personal cards (informations about an individual) in the same sheet.
I can identify the beginning of each card using a certain string .
Now, how can I split this cards using VB.NET 2010?
Should I use queries?
Thank you very much
claudio
34 Points
6 Posts
Jan 08, 2013 01:33 AM|LINK
Personally speaking, I think it is more easier to copy worksheet or cells than split. if you get the cell range, why not use copy the cells in a new sheet or a new workbook sheet. You can see below code:
Copy Excel Worksheet within Excel Workbook
workbook.Worksheets.Add("copied sheet1")
workbook.Worksheets(1).CopyFrom(workbook.Worksheets(0))
Copy Excel Worksheets between Excel Workbooks
Dim newsheet As Worksheet = CType(worksheet.Clone(worksheet.Parent),Worksheet) workbook.Worksheets.Add(newsheet)
Copy Excel cells
worksheet.Copy(worksheet.Range("A3:E5"),worksheet.Range("A19:E21"),True)
I use a .NET Excel application: http://www.e-iceblue.com/Introduce/excel-for-net-introduce.html
Jan 10, 2013 12:54 PM|LINK
Thank you Pandalin
ilclaudio
Member
6 Points
9 Posts
How to split Excel files with VB .NET 2010
Jan 07, 2013 09:10 PM|LINK
Hi all,
I have huge Excel files containing personal cards (informations about an individual) in the same sheet.
I can identify the beginning of each card using a certain string .
Now, how can I split this cards using VB.NET 2010?
Should I use queries?
Thank you very much
claudio
Pandalin
Member
34 Points
6 Posts
Re: How to split Excel files with VB .NET 2010
Jan 08, 2013 01:33 AM|LINK
Personally speaking, I think it is more easier to copy worksheet or cells than split. if you get the cell range, why not use copy the cells in a new sheet or a new workbook sheet. You can see below code:
Copy Excel Worksheet within Excel Workbook
workbook.Worksheets.Add("copied sheet1")
workbook.Worksheets(1).CopyFrom(workbook.Worksheets(0))
Copy Excel Worksheets between Excel Workbooks
Dim newsheet As Worksheet = CType(worksheet.Clone(worksheet.Parent),Worksheet)
workbook.Worksheets.Add(newsheet)
Copy Excel cells
worksheet.Copy(worksheet.Range("A3:E5"),worksheet.Range("A19:E21"),True)
I use a .NET Excel application: http://www.e-iceblue.com/Introduce/excel-for-net-introduce.html
ilclaudio
Member
6 Points
9 Posts
Re: How to split Excel files with VB .NET 2010
Jan 10, 2013 12:54 PM|LINK
Thank you Pandalin