#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Duplicates?

Hi all
I have a userform with 8 combobox's and I have them all linked to the same
row sources. How can I stop the user from selecting a same value as another
combobox in this group

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Duplicates?

Couldn't you use the click event to test it?

Private Sub ComboBox1_Change()
CheckValue ComboBox1
End Sub

Private Sub ComboBox2_Change()
CheckValue ComboBox2
End Sub

Sub CheckValue(Combo As MSForms.ComboBox)
Dim oCtl As Control

For Each oCtl In Me.Controls
If TypeName(oCtl) = "ComboBox" Then
If oCtl.Name < Combo.Name Then
If oCtl.ListIndex < -1 Then
If Combo.Value = oCtl.Value Then
MsgBox "Duplicate"
oCtl.ListIndex = -1
End If
End If
End If
End If
Next oCtl
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"browie" wrote in message
...
Hi all
I have a userform with 8 combobox's and I have them all linked to the same
row sources. How can I stop the user from selecting a same value as

another
combobox in this group

Thanks in advance




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
Do not allow duplicates txheart Excel Discussion (Misc queries) 3 September 15th 10 05:16 PM
Condensing a list with duplicates to a list with non-duplicates Nuclear Excel Worksheet Functions 2 July 29th 08 08:03 PM
Duplicates in excel that aren't 100% DUPLICATES ... [email protected] Excel Discussion (Misc queries) 4 May 2nd 08 06:43 PM
Duplicates? Zip Codes Excel Discussion (Misc queries) 1 June 3rd 05 04:17 PM
Duplicates Value Thomas[_9_] Excel Programming 1 December 1st 03 07:09 PM


All times are GMT +1. The time now is 10:39 AM.

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"