Function to Find Duplicates

R

Rocky McKinley

Hi I'm trying to make a function which looks for duplicates. Something
like...

Function DuplicateExists (BigRange as Range, Cell as Range) As Boolean
BigRange is always in worksheet "Main"
Cell is always in worksheet "Print"
DuplicateExists = False
'something like below
If cell exists in big Range and cell <> "" then
DuplicateExists = True
End if
End Function

I tried worksheetfunction.countif but it didn't seem to want to take the
worksheetname with the range.
Ideas?

Regards, Rocky McKinley
 
P

Patrick Molloy

countif should work just fine...

=COUNTIF(Rpint!E2:G15,Sheet1!C9)

whatever sheet you place this formula, it will return the
count of the value in sheet1C9 in the range E2:G15 on
sheet RPrint

Patrick Molloy
Microsoft Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top