+ Reply to Thread
Results 1 to 2 of 2

Return Error if 2 Conditions are Met (Stop Macro)

  1. #1
    Registered User
    Join Date
    07-10-2015
    Location
    Sacramento, California
    MS-Off Ver
    2010
    Posts
    17

    Return Error if 2 Conditions are Met (Stop Macro)

    I've got the meat of my macro done, it takes data from a main log and spreads it to fund spreadsheets for a quick summary.

    Account numbers coincide with the fund they are derived from.

    For example. Fund 0995 account numbers must start with a 17XXX
    Fund 0890 must start with a 101XX

    Is there a way to write in VBA code that would produce an error if a 17XXX account was written with a 0890 account number and vice versa? Basically it would state, "Error: The following account number does not coincide with the fund provided."


    Thanks in advance!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Return Error if 2 Conditions are Met (Stop Macro)

    Hello kevingcp,

    Your description of the problem is too general to provide you with specific answers. You will need to post a workbook with before and after examples.

    Please change or redact any private, confidential, or sensitive information prior to posting.

    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] If cell is empty in a variable range, stop macro and return error message
    By Andrei Kononenko in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-22-2019, 02:19 PM
  2. How to re run macro after ERROR' Command will stop the debugger'
    By chevenowner in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-10-2014, 07:12 AM
  3. Formulas Suddenly Stop Calculating and Return #Value error
    By KC8SPO in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-13-2013, 05:33 PM
  4. [SOLVED] Macro to Save file as PDF with Error to stop if name already exists
    By jan mason in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2013, 08:54 AM
  5. Macro or addin to generate buy, sell and stop signals under certain conditions
    By babapusy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 07:38 AM
  6. VBA IF Statement to return MsgBox if True and Stop Macro
    By Forge463 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2012, 01:56 PM
  7. How Do I stop this macro from running if there is an error?
    By jwichern1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-03-2011, 03:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1