Need help on a matching with vba

ilya2004

Board Regular
Joined
Mar 17, 2011
Messages
135
I have two lists in an excel spreasheet. One smaller one and one that is the "Master List."

I have some code that will manipulate the smaller list, but I only want to do it if it matches a value on the master list.

If I was doing it as a formula I would write

={OR(EXACT(SmallerList,Masterlist))}

as an aggregate function. How can I get VBA to do something parallel to this?

Also, I can't do a loop to check each cell of the master list because it could contain as many 70,000 cells.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try something like this:

Code:
Dim Cell As Range
For Each Cell in Range("SmallerList")
    If WorksheetFunction.CountIf(Range("MasterList"), Cell.Value) > 0 Then
'        Code to manipulate Cell 
    End If
Next Cell
 
Upvote 0

Forum statistics

Threads
1,203,326
Messages
6,054,747
Members
444,748
Latest member
knowak87

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