Just not my day: Invalid procedure call or argument

bemcbride

New Member
Joined
May 21, 2012
Messages
47
Hello everyone,I'm still having issue with a previous post.I've made the changes to my Macro but I'm getting a invalid procedure or argument error when C9 = "OK to submit". The correct msg box appears when C9 reads "Fields left to complete"When I debugger it shows this line...I've checked it over and over but can't find a miss...(I was thinking maybe it wanted "If ans" but when I did that it just kept erroring as well. Your help is very much appreciated! This is for a process improvement motion I'm having at my company (I'm trying to show off all the things excel CAN do"Sub SendEmail()'use the MsgBox object to inform the userDim ans As VbMsgBoxResultIf Range("C9").Value Like "*OK to submit*" Then ans = MsgBox("Are you ready to submit CC refund request?", vbYesNo, "Company Credit Card Department", , "Clicking Yes will send an email to credit cards for processing of your CC refund request") If ans = vbYes Then ActiveWorkbook.SendMail "email@company.com", "CC refund request for" & Range("B17").ValueElse MsgBox "You have not completed all required fields."End IfEnd Sub</pre>
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Sorry don't know what happened there:


Sub SendEmail()

'use the MsgBox object to inform the user
Dim ans As VbMsgBoxResultIf Range("C9").Value Like "*OK to submit*" Then
ans = MsgBox("Are you ready to submit CC refund request?", vbYesNo, "Company Credit Card Department", , "Clicking Yes will send an email to credit cards for processing of your CC refund request")
If ans = vbYes Then ActiveWorkbook.SendMail "email@company.com", "CC refund request for" & Range("B17").Value
Else
MsgBox "You have not completed all required fields."End IfEnd Sub
 
Upvote 0
Sorry I though I was supposed to start a new thread because it's a new issue with the previous thread.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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