Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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 |
#2
![]() |
|||
|
|||
![]()
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 |
#3
![]() |
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy without Hidden Cols - How | Excel Discussion (Misc queries) | |||
reminder notifications in a column | Excel Discussion (Misc queries) | |||
Excel won't copy outside sheet | Excel Discussion (Misc queries) | |||
Copy Function | Excel Discussion (Misc queries) | |||
Copy and pasting graphs to PowerPoint | Excel Discussion (Misc queries) |