Adding to script

Adrac

Active Member
Joined
Feb 13, 2014
Messages
272
Hello All,

Can you help. I would like to add a part to ths script i have a yes no option but want to add an N/A.
This is for scoreing on questions from 1-10. Each yes no gives 10 points.
Some questions are N/A so want to give 10 popints the same as if it was yes.

Code:
With ws.Shapes("drop down 3").ControlFormat
If .Value = 0 Then
MsgBox "You have not selected an answer for Question 2.", vbOKOnly, "Crossrail TfS Agent Scorecard"
Exit Sub
ElseIf .List(.Value) = "Yes" Then
intscore = intscore + 10
strq2 = "Yes"
Else
intscore = intscore
strq2 = "No"
End If
End With
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

dmt32

Well-known Member
Joined
Jul 3, 2012
Messages
6,393
Office Version
  1. 2019
Platform
  1. Windows
Hi,
not tested but see if this does what you want.

Code:
With ws.Shapes("drop down 3").ControlFormat
            
            If .Value = 0 Then
            
            MsgBox "You have not selected an answer for Question 2.", vbOKOnly, "Crossrail TfS Agent Scorecard"
        
            Else
            
                Select Case .List(.Value)

                    Case "Yes", "N/A"
                      intscore = intscore + 10
                       strq2 = IIf(.Value = 1, "Yes", "N/A")
                    Case Else
                      intscore = intscore
                      strq2 = "No"

                End Select
                
            End If
        End With

Dave
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,123,474
Messages
5,601,872
Members
414,479
Latest member
Beau the dog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top