+ Reply to Thread
Results 1 to 5 of 5

MsgBox only after all selected Macros are run?

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    USA
    MS-Off Ver
    MS Office for Office 365 (Latest - 32-bit)
    Posts
    107

    MsgBox only after all selected Macros are run?

    Right now I have 12 Macros called GenerateData1, GenerateData2, etc, and then a 13th which just calls 1 through 12 contiguously. I have separate checkboxes for all 13 macros and any combination can be checked and run.

    I'd like to give a Message Box that says Operation Complete but only after the last selected macro has finished running. Right now I have MsgBox "Operation Complete" at the end of each Macro, which works fine if the user only runs one macro at a time. How do I make a conditional MsgBox such that it only appears after the last macro completes?

    Thanks.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: MsgBox only after all selected Macros are run?

    Run 1 macro that scans and runs any macros checked in the list...

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-22-2013
    Location
    USA
    MS-Off Ver
    MS Office for Office 365 (Latest - 32-bit)
    Posts
    107

    Re: MsgBox only after all selected Macros are run?

    Quote Originally Posted by ranman256 View Post
    Run 1 macro that scans and runs any macros checked in the list...

    Please Login or Register  to view this content.
    Ranman, thanks for the reply. But I'm not sure I follow this solution. I have several Active X checkboxes each assigned to their own separate macro. I thought the solution to this might be something at the end of each macro that says IF <this is the last macro being run in the series> display the MsgBox, Else run the next macro in the series.

    Will this ActiveCell.Value work in this case?

  4. #4
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: MsgBox only after all selected Macros are run?

    Sorry,..didnt know...the activeX check boxes work different from the (easier) Form control check box.
    The form control will mark a cell true/false and you can just scan cells w the code I gave.
    The ActiveX version you must scan thru all objects..

    (pseudo code)
    for each ctl in controls
    if ctl.type = checkbox then
    if ctl.value then

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    USA
    MS-Off Ver
    MS Office for Office 365 (Latest - 32-bit)
    Posts
    107

    Re: MsgBox only after all selected Macros are run?

    Quote Originally Posted by ranman256 View Post
    Sorry,..didnt know...the activeX check boxes work different from the (easier) Form control check box.
    The form control will mark a cell true/false and you can just scan cells w the code I gave.
    The ActiveX version you must scan thru all objects..

    (pseudo code)
    for each ctl in controls
    if ctl.type = checkbox then
    if ctl.value then
    Ranman, thanks again for your reply.

    I must admit my novice in VBA - while I feel I've learned a lot, I'm still a little confused as to the syntax I should use with the code you've provided. I'm trying to mesh together the code you've provided in your 2 posts then figure out where to put it. Should this code be placed in the sheet that the checkboxes reside in? Or appended to each of my macros? Not sure here.

    Thanks again.

+ 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. Browse Folder Dialog - show msgbox if nothing selected
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-19-2014, 08:24 PM
  2. [SOLVED] MsgBox to Pop Up - When there is no data in a selected Range
    By Sinalk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2013, 08:45 AM
  3. [SOLVED] Export caption of selected checkbox to msgbox
    By SoulPrisoner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2013, 11:57 AM
  4. [SOLVED] If Row 9 is not selected, then msgbox
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2012, 01:36 PM
  5. Msgbox when worksheet is selected
    By obrien2010 in forum Excel General
    Replies: 2
    Last Post: 08-24-2010, 11:53 AM

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