With the block of commands below I am able to match cell A1 (DataByCC worksheet) with column A in several worksheets ; if there is a match,, then copy the whole row starting at column 12
Now I am trying to add something: If there is a match between A1 (in DataByCC worksheet) and the range A:D from the other worksheets then I want to pull the whole row starting at column 12
Sub temp()
LR = .Range("A" & Rows.Count).End(xlUp).Row
For i = j To LR
With .Range("A" & i)
If IsNumeric(Application.Match(.Value, Sheets("DataByCC").Columns("A"), 0)) Then
On Error Resume Next
.EntireRow.SpecialCells(12).Copy
Sheets("DataByCC").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
On Error GoTo 0
End If
End With
Now I am trying to add something: If there is a match between A1 (in DataByCC worksheet) and the range A:D from the other worksheets then I want to pull the whole row starting at column 12
Sub temp()
LR = .Range("A" & Rows.Count).End(xlUp).Row
For i = j To LR
With .Range("A" & i)
If IsNumeric(Application.Match(.Value, Sheets("DataByCC").Columns("A"), 0)) Then
On Error Resume Next
.EntireRow.SpecialCells(12).Copy
Sheets("DataByCC").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
On Error GoTo 0
End If
End With