Click here to Skip to main content
11,805,316 members (65,610 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB 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 OriginalGriff 315
1 Sergey Alexandrovich Kryukov 200
2 Richard Deeming 200
3 CPallini 160
4 CHill60 150
0 OriginalGriff 3,265
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web02 | 2.8.151002.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