AllExperts > Experts 
Search      

VB.NET

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB.NET Answers
Question Library

Ask a question about VB.NET
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Syed Rizwan Muhammad Rizvi
Expertise
I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.

Experience
Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.

 
   

You are here:  Experts > Computing/Technology > Basic > VB.NET > Copy columns of one worksheet to another

Topic: VB.NET



Expert: Syed Rizwan Muhammad Rizvi
Date: 9/19/2006
Subject: Copy columns of one worksheet to another

Question
I would like to do it with a GUI kind in VB.NET. The GUI provides two OpenFileDialog boxes to input the path of the source files and destination files. I have problem with PasteSpecial syntax.
-------------------------

Followup To

Question -
Hi,
Could you help me in copying columns of a worksheet in excel to another worksheet.I have many a worksheets from where particular columns, c20-c49 have to be copied and pasted to another worksheet. So i have multiple source worksheets but common destination worksheet.

Answer -
Is it related to MS Excel? if yes you can record a macro in MS Excel when you do the copying stuff manually for the first time and then on you can simply run that macro and it will do the job for you.

Answer
it should be easy to do then,

1. Add References of Microsoft Excel and Microsoft Office to your VB.Net project
2. Create an Excel Application Object
3. Open the work book using the application object which will return you the workbook object
4. Using the workbook object's worksheets collection you can retrieve the Worksheet you want to work on.
5. WorkSheet object will allow you to access cells i.e. read/write on them

If you need further help let me know.

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.