Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default check userform values in combination

I have a userform with a number of combo boxes. I would like to be
able to compare all the values, which the user has selected, with a
table on a spreadsheet. The top axis of the table has all the combobox
names on it, and the vertical axis is just numbers from 1 to N. Each
cell in a row of the table may contain a possible value of the combo
box, whose name is at the top of its column. The cell may also be
blank; this represents a don't-care. Each row then represents a
combination of values which are forbidden on the form.

EG. The table might look like this:

¦Combo1Name ¦Combo2Name ¦Combo3Name ¦Combo4Name
-------------------------------------------------------------------------------------------------------------------------------------
1 ¦Value1 ¦ ¦ValueTuesday ¦ValueMay
2 ¦Value1 ¦Valueb ¦ ¦
3 ¦Value3 ¦ ¦ ¦ValueJuly

Meaning that the values, as represented in rows 1, 2 and 3, cannot be
chosen in combination. If they are, I plan to make a warning appear.
I think I should check this on the change event of the combo boxes,
but I'm just not sure how to go about checking the combinations of
values against the table.
I'd be most grateful for any ideas.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default check userform values in combination

Private Sub ComboBox1_Change()

If Not IsError(Application.Match(ComboBox1.Value, _
Worksheets("Sheet1").Columns(1),0) Then
Msgbox "Found"
Else
MsgBox "Not found"
End If
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mcgurkle" wrote in message
s.com...
I have a userform with a number of combo boxes. I would like to be
able to compare all the values, which the user has selected, with a
table on a spreadsheet. The top axis of the table has all the combobox
names on it, and the vertical axis is just numbers from 1 to N. Each
cell in a row of the table may contain a possible value of the combo
box, whose name is at the top of its column. The cell may also be
blank; this represents a don't-care. Each row then represents a
combination of values which are forbidden on the form.

EG. The table might look like this:

¦Combo1Name ¦Combo2Name ¦Combo3Name ¦Combo4Name
-------------------------------------------------------------------------------------------------------------------------------------
1 ¦Value1 ¦ ¦ValueTuesday ¦ValueMay
2 ¦Value1 ¦Valueb ¦ ¦
3 ¦Value3 ¦ ¦ ¦ValueJuly

Meaning that the values, as represented in rows 1, 2 and 3, cannot be
chosen in combination. If they are, I plan to make a warning appear.
I think I should check this on the change event of the combo boxes,
but I'm just not sure how to go about checking the combinations of
values against the table.
I'd be most grateful for any ideas.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default check userform values in combination

On Jun 11, 1:16 pm, "Bob Phillips" wrote:
Private Sub ComboBox1_Change()

If Not IsError(Application.Match(ComboBox1.Value, _
Worksheets("Sheet1").Columns(1),0) Then
Msgbox "Found"
Else
MsgBox "Not found"
End If
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mcgurkle" wrote in message

s.com...
I have a userform with a number of combo boxes. I would like to be
able to compare all the values, which the user has selected, with a
table on a spreadsheet. The top axis of the table has all the combobox
names on it, and the vertical axis is just numbers from 1 to N. Each
cell in a row of the table may contain a possible value of the combo
box, whose name is at the top of its column. The cell may also be
blank; this represents a don't-care. Each row then represents a
combination of values which are forbidden on the form.

EG. The table might look like this:

¦Combo1Name ¦Combo2Name ¦Combo3Name ¦Combo4Name
---------------------------------------------------------------------------*----------------------------------------------------------
1 ¦Value1 ¦ ¦ValueTuesday ¦ValueMay
2 ¦Value1 ¦Valueb ¦ ¦
3 ¦Value3 ¦ ¦ ¦ValueJuly

Meaning that the values, as represented in rows 1, 2 and 3, cannot be
chosen in combination. If they are, I plan to make a warning appear.
I think I should check this on the change event of the combo boxes,
but I'm just not sure how to go about checking the combinations of
values against the table.
I'd be most grateful for any ideas.


Hi Bob,

Thanks for the quick reply. If I understand correctly, this will check
the value of the combo box individually against the value on the
spreadsheet. If at all possible, I would like to check the value
selected in the combo box - in combination with the values on the
other combo boxes on the userform. That is to say, a warning will only
appear if the values on the same row of the lookup table are selected
at the same time in their respective combo boxes.

So it's ok if I select "Value1" in combo box 1 and "Valuea" in combo
box 2, and it's also ok if I select "Value2" in combo box 1 and
"Valueb" in combo box 2, but if I select "Value1" in combo box 1 and
"Valueb" in combo box 2, then a warning appears.

Is there a way to apply your code to this problem?

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
Combination Bar Charts, Bars shrink when X-values inserted Tommy[_3_] Charts and Charting in Excel 3 July 6th 07 05:16 PM
Data Validation - combination of values Suzanne Excel Discussion (Misc queries) 3 January 3rd 07 01:11 AM
How lines in combination charts treat #N/A values Bernard Harris Charts and Charting in Excel 1 February 16th 06 04:15 AM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Check UserForm Values Before Saving MBlake[_2_] Excel Programming 13 May 11th 05 11:24 PM


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