Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy range to closed workbook
Hi
I'm trying to copy a range from the issue worksheet which is in the open workbook to the Issue workbook. The sheet name is from a dynamic formula on the lookuplists sheet which is open but hidden. It fails on the set Destrange line. Thanks Wendy Sub Movepost() Dim DestWB As Workbook Dim SourceRange As Range Dim DestRange As Range Dim WS As Worksheet Dim LRow As Integer Dim DestRow As Integer Dim DestWs As Worksheet Dim Destwsname As String Set WS = Sheets("LookupLists") Destwsname = Range("C1").Value 'week number and day eg W1Mon Set WS = Nothing Set WS = Worksheets("Issue") LRow = WS.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row - 1 Set SourceRange = ThisWorkbook.Worksheets("Issue").Range("A2:B" & LRow) SourceRange.Copy Set DestRange = Workbooks("d:\Issue.xls").Worksheets(Destwsname).R ange("A" & LRow) DestRange.PasteSpecial xlPasteValues, , False, False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy from closed workbook again! ;( | Excel Programming | |||
Copy data from a closed workbook (ADO) | Excel Programming | |||
Possible to copy sheets into another (closed!) workbook? | Excel Discussion (Misc queries) | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions | |||
How to copy a range to a closed workbook | Excel Programming |