Hello all,
Found this code on this form
It copies the row where in column AH is "shipped" to the sheet Backup.
Now it copies also the formulies. I want only values.
Tried to change this line;
to
But it error; PasteSpecial method of Worksheet class failed
What am i doing wrong?
Found this code on this form
It copies the row where in column AH is "shipped" to the sheet Backup.
Now it copies also the formulies. I want only values.
Tried to change this line;
VBA Code:
ActiveSheet.Paste
VBA Code:
ActiveSheet.PasteSpecial xlPasteValues
What am i doing wrong?
VBA Code:
Sub Copy()
Dim i As Long
Dim lngLastRow As Long, lngPasteRow As Long
lngLastRow = Sheets("Sheet1").Range("D65535").End(xlUp).Row
lngPasteRow = 4
For i = 4 To lngLastRow
If Sheets("Sheet1").Range("AH" & i).Value = "Shipped" Then
Sheets("Sheet1").Select
Range("A" & i & ":IV" & i).Copy
Sheets("Backup").Select
Range("A" & lngPasteRow & ":IV" & lngPasteRow).Select
ActiveSheet.Paste
lngPasteRow = lngPasteRow + 1
End If
Next i
End Sub