+ Reply to Thread
Results 1 to 5 of 5

Connecting two macros

  1. #1
    Registered User
    Join Date
    03-08-2007
    Posts
    24

    Connecting two macros

    Good day, I have two macros that are to run on one page. The first checks to ensure the required cells are filled in (RGACHECK), and the second (RGA_SEND) names/saves the file and emails to the appropriate individual.

    What I am hoping to achieve is if the first macro determines the cells are filled out, then it executes the second macro. If the cells are not filled out, the msg box states what cell(s) are empty and the user cannot proceed to the second macro until everything is filled out.

    Please Login or Register  to view this content.
    The second macro...

    Please Login or Register  to view this content.

    Both of the above macros work fine on their own, I am hoping someone here could help me connect the two macros.

    Thanks!

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Connecting two macros

    Before you exit the sub:
    Please Login or Register  to view this content.
    This will call the other macro when your If statements don't branch to the Cancel: label

    Or you could just copy and paste the other code before the exit sub line in the first macro.

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Connecting two macros

    See if this does what you want:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-08-2007
    Posts
    24

    Re: Connecting two macros

    Thanks for the quick replies! Palmetto, your solution worked perfect! Stephen, thanks for your input as well!

    I do have one additional question, on the second macro:

    Please Login or Register  to view this content.
    How would I have this file sent to an additional email address dependent upon a "YES" value in a specific cell (C11)?

    Thanks for all the assistance.

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Connecting two macros

    I would opt for a Select Case statement, but an IF statement would also work.
    Please Login or Register  to view this content.
    This bit of code above would replace your current line of code:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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