Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Finding a Duplicate using Vb

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

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

I prefer not to pass "Cell" to a worksheet cell as I will be testing many
Cells with this function and it will bog down Excel. Is there a speedy way
to do this using Vb.

I apologize about the re-post however I'm looking for the fastest Vb
solution.

--
Regards,
Rocky McKinley




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding a Duplicate using Vb


Function DuplicateExists (BigRange as Range, Cell as Range) As Boolean
if not isempty(cell) then
if application.countif(BigRange,Cell) 0 then
DuplicateExists = True
End if
End if
End Function

--
Regards,
Tom Ogilvy



"Rocky McKinley" wrote in message
...
Hi I'm trying to make a function which looks for duplicates using Vb.
Something
like...

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

I prefer not to pass "Cell" to a worksheet cell as I will be testing many
Cells with this function and it will bog down Excel. Is there a speedy

way
to do this using Vb.

I apologize about the re-post however I'm looking for the fastest Vb
solution.

--
Regards,
Rocky McKinley






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding duplicate value Ayo Excel Discussion (Misc queries) 2 October 27th 08 07:49 PM
Finding duplicate records Susan Excel Worksheet Functions 4 March 10th 08 10:07 PM
Finding Duplicate Entries ConfusedNHouston Excel Discussion (Misc queries) 2 October 11th 06 04:01 AM
Need help with finding duplicate entries Phil Excel Worksheet Functions 6 October 20th 05 03:56 AM
Finding duplicate data Eric Stoakes Excel Worksheet Functions 3 December 9th 04 04:33 PM


All times are GMT +1. The time now is 04:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"