Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am trying to use vba to copy a range from one file to another. The old file
is a log of dates and times, and the new file is an updated version of the log. The code is in a third workbook, and I have a command button to run the code. I get an error on the paste line, "Object doesn't support this property or method." Private Sub cmdImport_Click() Dim WkBk As Workbook Dim OldFile As String Dim NewFile As String OldFile = Application.GetOpenFilename If OldFile = "False" Then Exit Sub NewFile = ThisWorkbook.Path & "\" & "NewLog.xls" Set WkBk = Workbooks.Open(OldFile) With WkBk.Worksheets("Times") .Range("Log").Copy End With Set WkBk = Workbooks.Open(NewFile) With WkBk.Worksheets("Times") .Range("Log").Paste End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy Worksheet wont copy objects. | Excel Worksheet Functions | |||
copy graph from a Worksheet based on a field in another Worksheet | Excel Worksheet Functions | |||
Move/Copy or Copy/Insert worksheet? | Excel Discussion (Misc queries) | |||
copy part of a worksheet into a worksheet in the same file/keepi. | Excel Worksheet Functions | |||
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 | Excel Worksheet Functions |