Click here to Skip to main content
11,577,710 members (64,562 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
This I think is a simple solution. Just that I have spent too long trying to do it.

I have a worksheet named, "SheetA" and have headings from A1....D1 e.g. forename, surname, department, age

I want to copy and paste this line into my other worksheet "SheetB" at the same place.

How is this done?
Posted 8-Apr-13 6:31am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Maciej Los at 8-Apr-13 14:11pm
This is for VBA, not for VB.NET ;(
Kenneth Haugland at 8-Apr-13 14:52pm
I know, that is true, but they are easily converted. :-)
Maciej Los at 8-Apr-13 14:57pm
I know, i expected that you reply me this way ;)
Kenneth Haugland at 8-Apr-13 15:12pm
Google is rather predictable, I know :laugh:
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Using late binding Wink | ;)
        Dim oExc As Object = Nothing, oWbk As Object = Nothing
        Dim oSrcWsh As Object = Nothing, oDstWsh As Object = Nothing
            oExc = CreateObject("Excel.Applictaion")
            oWbk = oExc.Workbooks.Open("FullPathToWorkbook.xls")
            oSrcWsh = oWbk.WorkSheets("Sheet1")
            oDstWsh = oWbk.WorkSheets("Sheet2")
        Catch ex As Exception
            oSrcWsh = Nothing
            oDstWsh = Nothing
            oWbk = Nothing
            oExc = Nothing
        End Try

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Peter Leow 180
1 DamithSL 170
2 Richard MacCutchan 125
3 OriginalGriff 115
4 Abhinav S 100
0 OriginalGriff 820
1 Sergey Alexandrovich Kryukov 681
2 Abhinav S 528
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 375

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100