View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Duplicate values

This is a start

Dim aWS As Worksheet, WS As Worksheet
Dim aWSRange As Range, WSRange As Range


For Each aWS In ActiveWorkbook.Worksheets
Set aWSRange = aWS.Range("B4:B37")
For Each WS In ActiveWorkbook.Worksheets
If aWS.Name < WS.Name Then
Set WSRange = WS.Range("B4:B37")
For Each r In aWSRange
Debug.Print WS.Name, r.Address, r.Value
If Not IsEmpty(r) Then
For Each rng In WSRange
Debug.Print aWS.Name, r.Address, r.Value, WS.Name,
rng.Address, rng.Value
If r.Value = rng.Value And Not IsEmpty(rng) Then
MsgBox ("The value " & r.Value & " exists on
worksheet " & aWS.Name & " and " & WS.Name)
End If
Next rng
End If
Next r
End If
Next WS
Next aWS

End Sub


It does compare each sheet twice and I'm sure there's a way have it check
only once, but this should get you part of the way.



" wrote:

Hi

I have an workbook that has 31 identical pages which each page refer
to one day of the month. every day my helpers enters some information
in thoes pages.

I want to have code that will help me to search my work book (the 31
Pages) and find the client numbers in the range B4:B37 that has been
duplicated, And create a summary sheet that will show the client
number, how many times the this client number has been duplicated and
the first date the client number has been entered.

Thank you for any help in advance.