Подскажите как исправить код чтобы копировались только значения ячеек:
Код |
---|
Sub COPY_TOLKO_ZAGOTOVITELNU()
Dim iLastRow As Long, i As Long, LastRow As Long
iLastRow = Cells(Rows.Count, 1).End(xlUp).Row
With Sheets("DATA000")
LastRow = .Cells(Rows.Count, 1).End(xlUp).Row
'Cells(LastRow + 1, "D").ClearContents
'Range("D2:D10").ClearContents
.Range(.Cells(2, "D"), .Cells(LastRow + 1, "D")).ClearContents
.Range(.Cells(2, "J"), .Cells(LastRow + 1, "J")).ClearContents
.Range(.Cells(2, "P"), .Cells(LastRow + 1, "P")).ClearContents
LastRow = 1
For i = 2 To iLastRow
If InStr(1, Cells(i, "O"), "zag", vbTextCompare) <> 0 Then
Cells(i, "H").COPY .Cells(LastRow + 1, "D")
Cells(i, "K").COPY .Cells(LastRow + 1, "J")
Cells(i, "I").COPY .Cells(LastRow + 1, "P")
LastRow = LastRow + 1
End If
Next
End With
End Sub
|