LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Counting in a userform

I'm glad about that, as I had no further advice<vbg

Bob

"Dan" wrote in message
...
I made an error, go figure. Corrected and works great
Thanks, Dan
-----Original Message-----
Bob, I am a newbie as if you can't tell! Do I have to
replace the Me and the "Combo box"? Because when I run I
get a compile error:wrong # of arguments or invalid
property asignment. Thanks Dan
-----Original Message-----
Dan,

Count them and output the msgbox from within the form.

If
not more than one,
then exit.

This si some code for running from an OK type button.

'--------------------------------------------------------

-
--------
Private Sub Commandbutton1_Click()
'--------------------------------------------------------

-
--------
Dim ctl As msforms.Control
Dim iCbs As Long

For Each ctl In Me.Controls
If TypeName(ctl) = "ComboBox" Then
If ctl.ListIndex < -1 Then
i=i+1
If i 1 Then
MsgBox "Only select one"
Exit Sub
End If
End If
End If
Next ctl

Me.Hide

End Sub


--

HTH

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


"Dan" wrote in

message
...
I have 10 combo boxes in a userform frame. I would like
the user to select just ONE combo box. If any more

than
2
are select, and before my ActiveCell.Offset updates the
spreadsheet. I would like to catch this multiple input
error and send msgbox then Cancel=true back to the
userform for correction.

My 10 combo's are as follows:
cboA.Value
.
.
cboJ.Value
I thought that I could loop and count, if count great

than
1, stop and message, return and correct. My code

locked
me
up. Thanks.


.

.



 
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
counting function but not double counting duplicates JRD Excel Worksheet Functions 2 November 7th 07 06:43 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM


All times are GMT +1. The time now is 09:36 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"