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?
Thank you.
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.