Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Excel 2003 Visual Basic 6.3 I have a form with 24 text boxes. The names of the text boxes all start with “txt”, e.g. txtCHOL, txtALB, etc. The values that are entered into the text boxes can range from 1 to 24. Is there an easy way (VB code) to check that each box has a different number, that is, mutually exclusive. Thanks -- scantor145 ------------------------------------------------------------------------ scantor145's Profile: http://www.excelforum.com/member.php...o&userid=14766 View this thread: http://www.excelforum.com/showthread...hreadid=528559 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim tb As Control
Dim collNums As Collection Dim cTBs As Long Set collNums = New Collection For Each tb In Me.Controls If TypeName(tb) = "TextBox" Then cTBs = cTBs + 1 On Error Resume Next collNums.Add tb.Text, tb.Text On Error GoTo 0 End If Next tb If collNums.Count < cTBs Then MsgBox "All values must be unique" End If -- HTH Bob Phillips (remove nothere from email address if mailing direct) "scantor145" wrote in message ... Excel 2003 Visual Basic 6.3 I have a form with 24 text boxes. The names of the text boxes all start with "txt", e.g. txtCHOL, txtALB, etc. The values that are entered into the text boxes can range from 1 to 24. Is there an easy way (VB code) to check that each box has a different number, that is, mutually exclusive. Thanks -- scantor145 ------------------------------------------------------------------------ scantor145's Profile: http://www.excelforum.com/member.php...o&userid=14766 View this thread: http://www.excelforum.com/showthread...hreadid=528559 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a way to make 6 columns mutually exclusive? | Excel Worksheet Functions | |||
2 IF Statements not mutually exclusive | Excel Discussion (Misc queries) | |||
Making checkboxes mutually exclusive | Excel Discussion (Misc queries) | |||
Help: Multiple filters with mutually exclusive items | Excel Discussion (Misc queries) | |||
Req: How to create multiple mutually exclusive filters | Excel Worksheet Functions |