Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check a cell for duplicates.

With your help I have now managed to produce a really useful spreadshee
but I am being driven nuts by my inability to finish the final part!

Along with a bunch of other stuff my code creates a random number.

I have managed to find the next available cell in column A on a give
spreadsheet and place the number there.

What I want to do before entering the number is check that it doesn'
already exist somewhere in that column. If it is already present I wan
to loop until a unique one is found.

I have no doubt that this is really easy but I am just too dumb.....!

Thanks for your help

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Check a cell for duplicates.

Hi
see: http://www.cpearson.com/excel/NoDupEntry.htm

--
Regards
Frank Kabel
Frankfurt, Germany


With your help I have now managed to produce a really useful
spreadsheet but I am being driven nuts by my inability to finish the
final part!

Along with a bunch of other stuff my code creates a random number.

I have managed to find the next available cell in column A on a given
spreadsheet and place the number there.

What I want to do before entering the number is check that it doesn't
already exist somewhere in that column. If it is already present I
want to loop until a unique one is found.

I have no doubt that this is really easy but I am just too dumb.....!

Thanks for your help.


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check a cell for duplicates.

....sorry to be such a newbie here.

I have read the link, how do I use COUNTIF within my VB?

This seems to be a function within excel, I'm not sure how to access i
within the code.

Thanks

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check a cell for duplicates.

...worked it out guys.

Private Sub CommandButton1_Click()

With Worksheets("Sheet1").Columns("A:A")
Do
rand = Rnd()
Set oCell = .Find(rand)
Loop Until oCell Is Nothing
Worksheets("Sheet1").Range("a1").Value = rand
End With

End Su

--
Message posted from http://www.ExcelForum.com

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
check for duplicates Rod Excel Discussion (Misc queries) 10 January 25th 10 06:50 PM
Check for duplicates? Vass[_2_] Excel Worksheet Functions 5 October 24th 07 11:12 PM
check for duplicates Todd Excel Worksheet Functions 0 November 7th 06 05:59 PM
Check for Duplicates Carter68 Excel Worksheet Functions 3 April 15th 06 12:13 AM
Check for duplicates Pat Excel Worksheet Functions 8 February 17th 05 10:06 PM


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

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

About Us

"It's about Microsoft Excel"