Hi all I have this code And I need to add a condition if cells are >0 then paste any help is much appreciated
Chris
Sub Copy_Paste_Below_Last_Cell_new()
'Find the last used row in both sheets and copy and paste data below existing data.
Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
'Set variables for copy and destination sheets
Set wsCopy = ThisWorkbook.Worksheets(8)
Set wsDest = ThisWorkbook.Worksheets("Data collect")
'1. Find last used row in the copy range based on data in column A
lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "A").End(xlUp).Row
'2. Find first blank row in the destination range based on data in column A
'Offset property moves down 1 row
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row
'3. Copy & Paste Data
wsCopy.Range("A2:G" & lCopyLastRow).Copy
With wsDest.Range("A" & lDestLastRow)
.PasteSpecial xlValues
.PasteSpecial xlFormats
End With
Application.CutCopyMode = False
End Sub
Chris
Sub Copy_Paste_Below_Last_Cell_new()
'Find the last used row in both sheets and copy and paste data below existing data.
Dim wsCopy As Worksheet
Dim wsDest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
'Set variables for copy and destination sheets
Set wsCopy = ThisWorkbook.Worksheets(8)
Set wsDest = ThisWorkbook.Worksheets("Data collect")
'1. Find last used row in the copy range based on data in column A
lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "A").End(xlUp).Row
'2. Find first blank row in the destination range based on data in column A
'Offset property moves down 1 row
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row
'3. Copy & Paste Data
wsCopy.Range("A2:G" & lCopyLastRow).Copy
With wsDest.Range("A" & lDestLastRow)
.PasteSpecial xlValues
.PasteSpecial xlFormats
End With
Application.CutCopyMode = False
End Sub