Remove conditions

juneau730

Board Regular
Joined
Jun 7, 2018
Messages
80
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
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Watch MrExcel Video

Forum statistics

Threads
1,122,734
Messages
5,597,807
Members
414,177
Latest member
RezaAkhund

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