Skips the macro Call

HunterN

Active Member
Joined
Mar 19, 2002
Messages
479
I have a macro that asks the user is they want
to enter another project into the Userform
input boxes. If the user selects 'Yes' then it is suppose to Call a macro that will clear the fields. My problem is sometimes the macro just skips over the Call. I can even watch it in debug, where CheckMsg will = 6 and it should go outside the If statement and excute the next command but it doesn't. Any answers to this one?

Below is the code in the program:
Sub Add()
.
.
CheckMsg = MsgBox("Do you want to Enter another Project?", vbYesNo + vbQuestion)
If CheckMsg = vbNo Then
Call Clearboxes

Unload Frm2_Add
Frm1_Main.Show
Exit Sub
End If

Call Clearboxes
end sub
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
On 2002-10-01 11:57, HunterN wrote:
I have a macro that asks the user is they want
to enter another project into the Userform
input boxes. If the user selects 'Yes' then it is suppose to Call a macro that will clear the fields. My problem is sometimes the macro just skips over the Call. I can even watch it in debug, where CheckMsg will = 6 and it should go outside the If statement and excute the next command but it doesn't. Any answers to this one?

Below is the code in the program:
Sub Add()
.
.
CheckMsg = MsgBox("Do you want to Enter another Project?", vbYesNo + vbQuestion)
If CheckMsg = vbNo Then
Call Clearboxes

Unload Frm2_Add
Frm1_Main.Show
Exit Sub
End If

Call Clearboxes
end sub

Change your code from:

CheckMsg = MsgBox("Do you want to Enter another Project?", vbYesNo + vbQuestion)
If CheckMsg = vbNo Then
Call Clearboxes

to:

CheckMsg = MsgBox("Do you want to Enter another Project?", vbYesNo + vbQuestion)
If CheckMsg = vbNo Then Call Clearboxes


Regards,
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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