I have two columns.. when both columns are combined they are unique. so let say
Sheet1 I have:-
colA colB colC
1 2 AA
2 3 BB
1 4 CC
3 4 DD
2 5 DD
Sheet2 I have
ColA ColB Colc
1 4
3 5
2 5
usually i did this for sheet2
do loop until rngrow is > lastrow of sheet1
Set rngrow = .Find(What:=sapnotosearch, _
after:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rngrow Is Nothing Then
if col b of sheet 1 = colb of sheet 2 then
*perfect match*
else
*only column A matches.. col b does not match*
end if
else
*col A does not match*
end if
end loop
Is there a better way to do it? i dont like the idea of have to loop until lastrow. is there any function i can do so that the .Find function can match two column do something otherwise do nothing???
How to do a search without looping by matching 2 columns? i can pass two arguments to the .Find function??
Sheet1 I have:-
colA colB colC
1 2 AA
2 3 BB
1 4 CC
3 4 DD
2 5 DD
Sheet2 I have
ColA ColB Colc
1 4
3 5
2 5
usually i did this for sheet2
do loop until rngrow is > lastrow of sheet1
Set rngrow = .Find(What:=sapnotosearch, _
after:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rngrow Is Nothing Then
if col b of sheet 1 = colb of sheet 2 then
*perfect match*
else
*only column A matches.. col b does not match*
end if
else
*col A does not match*
end if
end loop
Is there a better way to do it? i dont like the idea of have to loop until lastrow. is there any function i can do so that the .Find function can match two column do something otherwise do nothing???
How to do a search without looping by matching 2 columns? i can pass two arguments to the .Find function??