Need Quick Macro Help!

B

bxc2739

I have _two_sheets__*1* & *2*. I’m to *match* customer from sheet 2 to
1.

I want to match by *zip code and by name*. If zip AND name of row(x)
in sheet 2
Matches with zip AND name of _ANY_of the 5000+ row(s) in sheet 1 then
highlight row(x) in sheet2. (to indicate a match)
If no match are found, then do nothing, and move on to next row of
sheet2 until all rows of sheet2 are finished comparing to the sheet1.

Basically *I need to compare TWO fields simultaneiously*, (double
match)
_per_row_to_the_respective_TWO_fields_with_the_second_sheet_I_am_comparing_too._
*If both criteria are meet then it is a match. * Otherwise it is left
alone/ignored. I want to do this for all 35000+ rows in my sheet2 which
will take a long time without the help of a macro. Both the sheet to be
worked on (sheet 2) and the sheet that exists only for comparison
(sheet1) are huge and have many entries.

If anyone can help with the code that would be great!


Thanks
Bo
 
B

bxc2739

Additionally:

I have already succeeding in comparing ONLY the zip code.

Here is the code:

Option Explicit

Sub CheckExists()
Dim c As Range, cl As Range, rSearch As Range, rStart As Range

Set rSearch = Worksheets("Siebel").Range("s1",
Worksheets("Siebel").Range("s65536").End(xlUp))
Set rStart = Worksheets("Work").Range("B1",
Worksheets("Work").Range("b65536").End(xlUp))
With Application
ScreenUpdating = False
Calculation = xlManual

For Each cl In rStart
With rSearch
Set c = .Find(cl.Value, LookIn:=xlValues)
If Not c Is Nothing Then
cl.EntireRow.Interior.ColorIndex = 3
End With
Next cl

Application.ScreenUpdating = True
Calculation = xlCalculationAutomatic
End With
End Sub

royUk at ozgrid gave me this code and it works wonderfully

What I need to do now is the *second step*:
_How_do_I_compare_AT_THE_SAME_TIME_both_the_ZIP_CODE_(numeric)_AND_the_CUSTOMER_NAME_(string/character/word)_of_sheet2_to_the_Zip_and_Name_of_sheet1.??_

Do I need a nested FOR LOOP or a seperate for Loop after the first
one??
How shall I go about coding this? I've tried a lot of things but it
never works..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top