Share via

VBA Code Status Sending

Anonymous
2023-07-08T07:19:54+00:00

Dear Sir,

I am using MS Excel here.

I wanted to send the status as "Ready", "Started", " Not Started." to Excel Sheet Cell Number like shown below :

How to do it using VBA Code, My requirement is When VBA Code Started, it should popup that," Started" and then When VBA Code Execution is completed, then it should say " Completed"

How to do it using VBA Code?

Thanks.

Best Regards,

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2023-07-08T17:52:17+00:00

    Yes, you are almost there. Kindly use the updated code below: Sub UpdateStatus() ' Disable screen updating Application.ScreenUpdating = False DoEvents

    ' Display "Started" status Range("A1"). Value = "Started"

    ' Your VBA code here

    ' Display "Completed" status Range("A1"). Value = "Completed"

    ' Enable screen updating Application.ScreenUpdating = True End Sub

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-07-08T15:03:57+00:00

    Do you mean that, i will need to write my code as below? :

    Sub UpdateStatus() '

    Application.Screenupdating= False

    DoEvents

    Display "Started" status

    Range("A1"). Value = "Started"

    ' Your VBA code here

    ' Display "Completed" status

    Range("A1"). Value = "Completed"

    Application.Screenupdating= True

    End Sub

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-07-08T11:12:16+00:00

    If you have disabled screen updating using Application.ScreenUpdating = False at the beginning of your code, it means that the changes made to the worksheet will not be immediately visible on the screen. In this case, updating the status in cell A1 will not be visible until screen updating is enabled again. To address this, you can use the DoEvents statement to allow the screen to update before your code execution begins.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-07-08T08:55:01+00:00

    But my below code is active at the beginning of the code:

    Application.ScreenUpdating= False

    Code Lines

    Application.ScreenUpdating= True

    Because of this, code is not getting executed.

    What is the solution for this?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-07-08T07:56:32+00:00

    Hi ExcelSuperXW, I'm Femi and I'd be happy to help you with your question. Open Excel and Press ALT + F11 to open the Visual Basic for Applications (VBA) editor. Insert a new module by clicking on Insert > Module. Copy and paste the code below into the new module: Sub UpdateStatus() ' Display "Started" status Range("A1"). Value = "Started"

    ' Your VBA code here

    ' Display "Completed" status Range("A1"). Value = "Completed" End Sub

    Close the VBA editor. Press ALT + F8 to open the "Macro" dialog box. Select the "UpdateStatus" macro and click on Run.

    In this code, I've assumed that you want to update the status in cell A1 of the active sheet. You can modify the cell reference (e.g., "A1") to your desired cell.

    Hope this helps!

    Best Regards, Femi

    Was this answer helpful?

    0 comments No comments