![]() |
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").Cop y ****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 |
try something likethis
Public Sub test() Sheet1.UsedRange.Copy Sheet2.Range("a1").PasteSpecial Application.CutCopyMode = False End Sub ====================== "Michael" wrote in message ... 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").Cop y ****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 |
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" wrote in message ... 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").Cop y ****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 |
All times are GMT +1. The time now is 02:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com