I have _two_sheets__*1* amp; *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_sec ond_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--
bxc2739
------------------------------------------------------------------------
bxc2739's Profile: www.excelforum.com/member.php...oamp;userid=32538
View this thread: www.excelforum.com/showthread...hreadid=535657
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(quot;Siebelquot;).Range(quot;s1quot;,
Worksheets(quot;Siebelquot;).Range(quot;s65536quot;).End(xlUp))
Set rStart = Worksheets(quot;Workquot;).Range(quot;B1quot;,
Worksheets(quot;Workquot;).Range(quot;b65536quot;).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_CO DE_(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..--
bxc2739
------------------------------------------------------------------------
bxc2739's Profile: www.excelforum.com/member.php...oamp;userid=32538
View this thread: www.excelforum.com/showthread...hreadid=535657
Here is a picture for clarity:
www.freewebs.com/bxc2739/help.bmp -------------------------------------------------------------------
|Filename: help.JPG |
|Download: www.excelforum.com/attachment.php?postid=4687 |
-------------------------------------------------------------------
--
bxc2739
------------------------------------------------------------------------
bxc2739's Profile: www.excelforum.com/member.php...oamp;userid=32538
View this thread: www.excelforum.com/showthread...hreadid=535657
- Dec 18 Thu 2008 20:48
Need Quick Macro Help!
close
全站熱搜
留言列表
發表留言