All,
I see a lot of people copy and pasting data from other sheets using copy and paste, however it doesn't appear to work when using a destination. Any ideas how to fix this?
I see a lot of people copy and pasting data from other sheets using copy and paste, however it doesn't appear to work when using a destination. Any ideas how to fix this?
VBA Code:
For Each WSheet In Worksheets
With WSheet
lastRow = .Range("A" & Rows.Count).End(xlUp).row
If .Range("J" & lastRow).Value = "<>" Then
ElseIf .Range("A" & lastRow).Value < Date Then
Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lastCol As Long
Dim lDestLastRow As Long
Set wsCopy = WSheet
Set wsDest = Workbooks("due.xls").Worksheets("sheet1")
lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, 1).End(xlUp).row
lastCol = wsCopy.Cells(2, wsCopy.Columns.Count).End(xlToLeft).Column
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).row
With wsCopy
.Range(.Cells(1, 1), .Cells(lCopyLastRow, lastCol)).Copy wsDest.Range("A" & lDestLastRow)
End With
End If