+ Reply to Thread
Results 1 to 8 of 8

Msg Box That States "Macro is Running" and drops when Marco is finished running

  1. #1
    Registered User
    Join Date
    07-29-2019
    Location
    Los Angeles. Ca
    MS-Off Ver
    2013
    Posts
    38

    Red face Msg Box That States "Macro is Running" and drops when Marco is finished running

    Hi VBA Gurus!

    I would like to add to my module a MSGBOX that the "Macro is Running" before my subroutine and stops when the marco is completed. The below code works, but, when my Macro is done, the "Macro Working" MSG does not drop. Maybe it is because the "Application.StatusBar=False it ticked? or is there another way to write this?


    Sub myMarcoRunningMSG()
    With ActiveWindow
    'If user works on Sheet, stop code & clear display.
    Application.StatusBar = "Marco Working"
    'Application.StatusBar = False
    End With
    End Sub


    Thank you for your help!!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Msg Box That States "Macro is Running" and drops when Marco is finished running

    Quote Originally Posted by Kimber154 View Post
    Maybe it is because the "Application.StatusBar=False it ticked?
    Definitely that is why. The tick mark indicates that line is a comment and is not to be executed. However, you do not want that there anyway because it would just clear the message immediately after the message is displayed.

    To show a message box that stays up during the macro you have to write a custom UserForm and set it to modeless. I can put one in your file if you attach it.

    Also please see Forum Guideline #2 about code tags and adjust accordingly. We suggest you click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-29-2019
    Location
    Los Angeles. Ca
    MS-Off Ver
    2013
    Posts
    38

    Re: Msg Box That States "Macro is Running" and drops when Marco is finished running

    Hi Jeff,

    Many Thanks for your assistance with this. Below is the code, a basic copy and paste columns macro:

    CODE:

    'Get lrow
    lrow = Worksheets("Master").Range("C1").End(xlDown).Row


    'Code to Copy
    For i = 2 To lrow
    If Worksheets("Master").Cells(i, 33).Value = "" Then
    Worksheets("Master").Cells(i, 33).Value = Worksheets("Copy Sheet").Cells(i, 29).Value
    End If

    If Worksheets("Master").Cells(i, 38).Value = "" Then
    Worksheets("Master").Cells(i, 38).Value = Worksheets("Copy Sheet").Cells(i, 33).Value
    End If

    If Worksheets("Master").Cells(i, 39).Value = "" Then
    Worksheets("Master").Cells(i, 39).Value = Worksheets("Copy Sheet").Cells(i, 34).Value
    End If

    If Worksheets("Master").Cells(i, 40).Value = "" Then
    Worksheets("Master").Cells(i, 40).Value = Worksheets("Copy Sheet").Cells(i, 35).Value
    End If

    If Worksheets("Master").Cells(i, 45).Value = "" Then
    Worksheets("Master").Cells(i, 45).Value = Worksheets("Copy Sheet").Cells(i, 38).Value
    End If

    If Worksheets("Master").Cells(i, 46).Value = "" Then
    Worksheets("Master").Cells(i, 46).Value = Worksheets("Copy Sheet").Cells(i, 39).Value
    End If

    Next i

    MsgBox "Copied Columns from Copy Sheet to Master Marco Finished"

    End Sub

    CODE

    Thank you,

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Msg Box That States "Macro is Running" and drops when Marco is finished running

    Quote Originally Posted by 6StringJazzer View Post
    I can put one in your file if you attach it.
    The code is not what I need. I need to create a new UserForm. I could give you a bunch of instructions for how to do it, but if you attach your file I can just do it for you.

  5. #5
    Registered User
    Join Date
    07-29-2019
    Location
    Los Angeles. Ca
    MS-Off Ver
    2013
    Posts
    38

    Talking Re: Msg Box That States "Macro is Running" and drops when Marco is finished running

    Hi Jeff,

    Apologies for misunderstanding. I have reduced the file size in order to upload, please note attached.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Msg Box That States "Macro is Running" and drops when Marco is finished running

    Here is a simple one that just shows a message. You could modify it to show how many rows have been processed.

  7. #7
    Registered User
    Join Date
    07-29-2019
    Location
    Los Angeles. Ca
    MS-Off Ver
    2013
    Posts
    38

    Re: Msg Box That States "Macro is Running" and drops when Marco is finished running

    Thanks Jeff! Let me check it out. I have not, yet, moved to the status bar ,, but looking to!

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Msg Box That States "Macro is Running" and drops when Marco is finished running

    Using the status bar is pretty easy.

    Before the loop:
    Please Login or Register  to view this content.
    After the loop:
    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)

Similar Threads

  1. [SOLVED] Execution Error "Range of the object failed" when running macro
    By jeriss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2023, 05:25 AM
  2. Replies: 3
    Last Post: 07-24-2018, 03:05 PM
  3. [SOLVED] Create timer to check running time for "Master" macro
    By olli.excel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2017, 05:52 AM
  4. Workbook_SheetChange macro deletes all "undo" ("redo") states
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2017, 04:24 PM
  5. [SOLVED] Enabling "Undo" after running a macro - Excel 2010/2013
    By Rizzu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-18-2014, 01:57 PM
  6. Setting "Current" access database and running macro from Excel
    By beat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2013, 12:07 PM
  7. Replies: 6
    Last Post: 08-09-2006, 08:19 AM

Tags for this Thread

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