Adding to script

Adrac

Active Member
Joined
Feb 13, 2014
Messages
280
Office Version
  1. 365
Platform
  1. Windows
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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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:
Upvote 0
Hello Dave,

Thank you so much works a charm :)

Adrac
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,312
Members
448,564
Latest member
ED38

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
Back
Top