Remove conditions

juneau730

Board Regular
Joined
Jun 7, 2018
Messages
115
Office Version
  1. 365
Platform
  1. Windows
Okay, I am having a total brain fart and should be able to figure this out.. This is part of the code for one function in my massive dBase. As you see it's a Yes, No, Cancel call. I want it to default to NO all the time and go right to the IF statement, without it popping up the Yes, No, Cancel message box

Code:
strIntroMessage = "Click 'Yes' to query " & Replace(strTargetOU," ","")strIntroMessage = strIntroMessage & vbCrLf & vbCrLf & "Click 'No' to select a different OU to query"


strChoice = MsgBox(strIntroMessage,vbYesNoCancel,"Select Target Container")
' Yes=6 No=7 Cancel=2


If strChoice = 7 Then
	GetTargetLocation
ElseIf strChoice = 2 Then
	WScript.Echo vbTab & "*** Action has been cancelled. Quitting..." & vbCrLf
	WScript.Quit
End If
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,225,743
Messages
6,186,773
Members
453,370
Latest member
juliewar

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