silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hi guys,
hope someone can look over my code and let me know what's wrong with this code.
The issue I am getting an Runtime Error on Line "tabWeeklyPlaner.range(Cells(i,1).copy"
tabWeeklyPlaner and tabWeeklyObjects are the Codenames of the Worksheets.
Also I as the tabWeeklyPlaner has in the range of Cells blanks and a Summery on the last used Cell.
I like to copy all not blank cells and without Summery into tabWeeklyObjects.
Can someone give me a hand on this please.
Thanks
Albert
hope someone can look over my code and let me know what's wrong with this code.
Code:
Sub CopyNonBlankData()
Dim wkbThis As Workbook
Dim lngERow As Long
Dim lngLRow As Long
Dim i As Integer
Set wkbThis = ActiveWorkbook
lngLRow = tabWeeklyPlaner.Cells(Rows.Count, 1).End(xlUp).Row
With ThisWorkbook
For i = 3 To lngLRow
If tabWeeklyPlaner.Cells(i, 1) <> "" Then
tabWeeklyPlaner.Range(Cells(i, 1)).Copy
tabWeeklyObjects.Activate
lngERow = tabWeeklyObjects.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ActiveSheet.Paste Destination:=tabWeeklyObjects.Range(Cells(lngERow, 1))
tabWeeklyPlaner.Activate
End If
Next i
End With
Application.CutCopyMode = False
End Sub
The issue I am getting an Runtime Error on Line "tabWeeklyPlaner.range(Cells(i,1).copy"
tabWeeklyPlaner and tabWeeklyObjects are the Codenames of the Worksheets.
Also I as the tabWeeklyPlaner has in the range of Cells blanks and a Summery on the last used Cell.
I like to copy all not blank cells and without Summery into tabWeeklyObjects.
Can someone give me a hand on this please.
Thanks
Albert