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
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

dmt32

Well-known Member
Joined
Jul 3, 2012
Messages
7,337
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:
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,282
Messages
5,836,388
Members
430,425
Latest member
xlsee

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