Array

bgonen

Active Member
Joined
Oct 24, 2009
Messages
264
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
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Sorry, I built this thread in a rush and didn't explain myself clearly

However, I found a partial solution (that works for me,, for now):

LR = .Range("D" & Rows.Count).End(xlUp).Row
For i = j To LR
With .Range("D" & i)
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top