Hi,
Im having this code below to copy+paste data from sheet1 to sheet2, but running it seems to make my file HUGE. Any ideas how to solve this?
I have 2000 rows data in sheet1 so no more rows can be copied into sheet2. Now I think the code effects all rows in sheet2 (?).
Sub CopyCell()
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("H" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If .Range("H" & i).Value = "SalesPerson1" And .Range("J" & i).Value = "Sold" Then
dlr = Sheets("Sheet2").Cells(Rows.Count, "D").End(xlUp).Row + 1
.Range("A" & i).Resize(1, 9).Copy Destination:=Sheets("Sheets2").Range("D" & dlr)
Sheets("Sheets2").Range("C" & dlr) = Date
End If
Next i
End With
End Sub
Im having this code below to copy+paste data from sheet1 to sheet2, but running it seems to make my file HUGE. Any ideas how to solve this?
I have 2000 rows data in sheet1 so no more rows can be copied into sheet2. Now I think the code effects all rows in sheet2 (?).
Sub CopyCell()
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("H" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If .Range("H" & i).Value = "SalesPerson1" And .Range("J" & i).Value = "Sold" Then
dlr = Sheets("Sheet2").Cells(Rows.Count, "D").End(xlUp).Row + 1
.Range("A" & i).Resize(1, 9).Copy Destination:=Sheets("Sheets2").Range("D" & dlr)
Sheets("Sheets2").Range("C" & dlr) = Date
End If
Next i
End With
End Sub