View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Dupes in a range

Hi Howard,

Am Sat, 28 May 2016 16:17:16 -0700 (PDT) schrieb L. Howard:

Very clever! Works perfect.


not clever enough. The line
TwoDigitDupes = "N"
should be out of the loop.

Try:

Function TwoDigitDupes(myRng As Range) As String
Dim rngC As Range
For Each rngC In myRng
If rngC 9 And rngC < 100 And Application.CountIf(myRng, rngC) 1 Then
TwoDigitDupes = "Y"
Exit Function
End If
Next
TwoDigitDupes = "N"
End Function


Regards
Claus B.
--
Windows10
Office 2016