Search matched fields from changed row to other worksheets of the right hand side

logstarter

New Member
Joined
Apr 14, 2017
Messages
39
Hi,

I have a excel log book for booking resources with multiple worksheets for each month of the year. Each worksheet has the same templates (same headers).

Like Column A-D is for Book A, E-H is for Book B...etc
and Column A, E will record the user name,
Column B, F will record the contact no...etc.

What I would like to do is to check if there are any duplicate user name and contact no in/after the input row. I think I need to have two for loop to loop through the worksheets and the rows. But I have no idea how to do the searching to match both name and contact no. Would anyone could give some advices, please?

Code:
Function checkduplicate (byval target as range) as Boolean
    For i = ActiveSheet.Index To ActiveWorkbook.Worksheets.count
        For j = ChangedCell.Row To 200   'assume max row of the worksheet is 500
            
        Next j
        
    Next i
' if no duplicate
   checkduplicate = false
end function

Thank you.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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