With the code below I am able to match cell A1 in worksheet:"DataByCC" with values range on column A to the last used cell on that column (col A)
If there is a match then I copy the entire row on the other Workshhets to DataByCC
The only eDIT/CHANGE I am trying to do is do the match (cell A1 in DataByCC) with columns A through F,,,if there is a match just copy the entire row to "DataByCC"
I hope someone can help
Thanks
bg
Dim LR As Long, i As Long, ws As Worksheet, j As Long
Dim k%, NextRow&
Application.ScreenUpdating = False
Sheets("DataByCC").UsedRange.Offset(1).ClearContents
For Each ws In Sheets(Array("REVENUE", "PAYROLL", "Benefits"))
With ws
Select Case .Name
Case "CapEX": j = 13
Case Else: j = 9
End Select
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
Next i
End With
Next ws
If there is a match then I copy the entire row on the other Workshhets to DataByCC
The only eDIT/CHANGE I am trying to do is do the match (cell A1 in DataByCC) with columns A through F,,,if there is a match just copy the entire row to "DataByCC"
I hope someone can help
Thanks
bg
Dim LR As Long, i As Long, ws As Worksheet, j As Long
Dim k%, NextRow&
Application.ScreenUpdating = False
Sheets("DataByCC").UsedRange.Offset(1).ClearContents
For Each ws In Sheets(Array("REVENUE", "PAYROLL", "Benefits"))
With ws
Select Case .Name
Case "CapEX": j = 13
Case Else: j = 9
End Select
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
Next i
End With
Next ws