Well, i attached my file. The problem is that when I have a formula into a column, the macro doesn't do a paste/value.
Any help?
Here is the coding:
Sub CopyData()
Application.ScreenUpdating = False
Sheets("Result").Rows("2:" & Rows.Count).ClearContents
Dim bottomD As Integer
bottomD = Range("D" & Rows.Count).End(xlUp).row
Dim x As Long
For x = 2 To bottomD
Cells(x, 1).Resize(, 4).Copy Sheets("Result").Cells(Rows.Count, "B").End(xlUp).Offset(1, 0)
If Cells(x, "E") = "MATCH" And Cells(x, "K") <> 0 Then
Cells(x, "K").Copy
Sheets("Result").Cells(Rows.Count, "H").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
ElseIf Cells(x, "E") = "MATCH" And Cells(x, "K") = 0 Then
Cells(x, "G").Copy
Sheets("Result").Cells(Rows.Count, "H").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
ElseIf Cells(x, "E") = "MATCH" Then
Cells(x, "D").Copy
Sheets("Result").Cells(Rows.Count, "H").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
ElseIf Cells(x, "E") = "NO MATCH" Then
Cells(x, "G").Copy
Sheets("Result").Cells(Rows.Count, "H").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
End If
Application.CutCopyMode = False
Next x
Application.ScreenUpdating = True
End Subextremis.xlsm
Bookmarks