+ Reply to Thread
Results 1 to 3 of 3

Copy

  1. #1
    Michael
    Guest

    Copy

    Hi...

    I have a small problem but still need some help.

    I have a workbook called "Sumary.xls" located in a folder

    Dim strPath As String
    Dim strParent As String
    Dim pos As Long
    Dim Slutt As String

    strPath = ActiveWorkbook.Path

    **** Then i have to open another workbook called "Statistikk.xls"

    pos = InStrRev(strPath, "\")

    strParent = Left(strPath, pos - 1)

    Slutt = strParent & "\VT" & "\VT" & "\Arkiv\" & "Statistikk.xls"

    Workbooks.Open Slutt

    ***Everything is ok with this, but:

    ***** Then i want to copy the sheet "stat" in the "Statistikk.xls" workbook

    Workbooks("Statistikk.xls").Worksheets("stat").Copy

    ****And paste it to a sheet called "VT" in the "sumary" workbook.

    ThisWorkbook.Worksheets("VT").Paste =
    Workbooks("Statistikk.xls").Worksheets("stat")


    But this doesnt work, please help!

    Mike
    --
    Nil Satis Nisi Optimum

  2. #2
    R.VENKATARAMAN
    Guest

    Re: Copy

    try something likethis

    Public Sub test()
    Sheet1.UsedRange.Copy
    Sheet2.Range("a1").PasteSpecial
    Application.CutCopyMode = False
    End Sub
    ======================
    "Michael" <[email protected]> wrote in message
    news:[email protected]...
    > Hi...
    >
    > I have a small problem but still need some help.
    >
    > I have a workbook called "Sumary.xls" located in a folder
    >
    > Dim strPath As String
    > Dim strParent As String
    > Dim pos As Long
    > Dim Slutt As String
    >
    > strPath = ActiveWorkbook.Path
    >
    > **** Then i have to open another workbook called "Statistikk.xls"
    >
    > pos = InStrRev(strPath, "\")
    >
    > strParent = Left(strPath, pos - 1)
    >
    > Slutt = strParent & "\VT" & "\VT" & "\Arkiv\" & "Statistikk.xls"
    >
    > Workbooks.Open Slutt
    >
    > ***Everything is ok with this, but:
    >
    > ***** Then i want to copy the sheet "stat" in the "Statistikk.xls"

    workbook
    >
    > Workbooks("Statistikk.xls").Worksheets("stat").Copy
    >
    > ****And paste it to a sheet called "VT" in the "sumary" workbook.
    >
    > ThisWorkbook.Worksheets("VT").Paste =
    > Workbooks("Statistikk.xls").Worksheets("stat")
    >
    >
    > But this doesnt work, please help!
    >
    > Mike
    > --
    > Nil Satis Nisi Optimum




  3. #3
    Michael
    Guest

    Re: Copy

    PERFECT!!

    Thank's R.VENKATARAMAN

    Mike
    --
    Nil Satis Nisi Optimum


    "R.VENKATARAMAN" wrote:

    > try something likethis
    >
    > Public Sub test()
    > Sheet1.UsedRange.Copy
    > Sheet2.Range("a1").PasteSpecial
    > Application.CutCopyMode = False
    > End Sub
    > ======================
    > "Michael" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi...
    > >
    > > I have a small problem but still need some help.
    > >
    > > I have a workbook called "Sumary.xls" located in a folder
    > >
    > > Dim strPath As String
    > > Dim strParent As String
    > > Dim pos As Long
    > > Dim Slutt As String
    > >
    > > strPath = ActiveWorkbook.Path
    > >
    > > **** Then i have to open another workbook called "Statistikk.xls"
    > >
    > > pos = InStrRev(strPath, "\")
    > >
    > > strParent = Left(strPath, pos - 1)
    > >
    > > Slutt = strParent & "\VT" & "\VT" & "\Arkiv\" & "Statistikk.xls"
    > >
    > > Workbooks.Open Slutt
    > >
    > > ***Everything is ok with this, but:
    > >
    > > ***** Then i want to copy the sheet "stat" in the "Statistikk.xls"

    > workbook
    > >
    > > Workbooks("Statistikk.xls").Worksheets("stat").Copy
    > >
    > > ****And paste it to a sheet called "VT" in the "sumary" workbook.
    > >
    > > ThisWorkbook.Worksheets("VT").Paste =
    > > Workbooks("Statistikk.xls").Worksheets("stat")
    > >
    > >
    > > But this doesnt work, please help!
    > >
    > > Mike
    > > --
    > > Nil Satis Nisi Optimum

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1