W
Wendy
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).Range("A" & LRow)
DestRange.PasteSpecial xlPasteValues, , False, False
End Sub
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).Range("A" & LRow)
DestRange.PasteSpecial xlPasteValues, , False, False
End Sub