close

Quick question.

Say i have a combobox with 5 answers in, 1 2 3 4 and 5.

Is there anyway to get this information into and IF command.

I need Cell F11 to run the macro 'Correct' if the answer is 4 or run
the macro 'Incorrect' if it is 1 2 3 or 5.

Urgent reply needed, thanks alot.

Rob.--
R.Chapman
------------------------------------------------------------------------
R.Chapman's Profile: www.excelforum.com/member.php...oamp;userid=31631
View this thread: www.excelforum.com/showthread...hreadid=513236The following worksheet event macro should do:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = quot;$D$2quot; Then
If Range(quot;D2quot;) = 4 Then
Call Correct
Else
Call Incorrect
Endif
Endif
End Sub

We assume that the combo box is linked to cell D2 in this worksheet. To
include,
Right-Click on the sheet tab, select View Code and paste the code. Once
you are in this module you can go to the top of the code window and see
which other events can be handled with event procedures.

HTH
Kostis Vezerides

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()