Auto close message box after 1 minute

ste33uka

Active Member
Joined
Jan 31, 2020
Messages
471
Office Version
  1. 365
Platform
  1. Windows
Hi i use the following code for a message box, is there anyway it would auto close message box on 1 minute if i have not clicked before then?

VBA Code:
Private Sub Worksheet_Message()
Dim Msg As Long
    Dim myRange As Range
    Set myRange = Sheet85.Range("BD1:BD999")
    Dim cell As Range
    For Each cell In myRange
        Evaluate (cell)
        If StrComp(cell, "Yes", vbTextCompare) = 0 Then
        Cells(cell.Row, "BA") = 999999
        AppActivate Application.Caption
            Msg = MsgBox("" & vbCrLf & " " & Range("BG" & cell.Row).Value & vbCrLf & Range("BP" & cell.Row).Value & vbCrLf & Range("BQ" & cell.Row) & Range("BR" & cell.Row).Value, vbExclamation)
        End If
    Next
        Set myRange = Sheet85.Range("BE1:BE999")

    For Each cell In myRange
        Evaluate (cell)
        If StrComp(cell, "Yes", vbTextCompare) = 0 Then
        Cells(cell.Row, "BC") = 999999
        AppActivate Application.Caption
            Msg = MsgBox("" & vbCrLf & " " & Range("BG" & cell.Row).Value & vbCrLf & Range("BP" & cell.Row).Value & vbCrLf & Range("BQ" & cell.Row) & Range("BR" & cell.Row).Value, vbExclamation)
           
        End If
    Next                 
    End Sub
 
Last edited:
so i can delete "Evaluate (cell)"
I didn't say to delete it. The most important question is why is it there in the first place?

I'll see if I can figure out how to run your code (hard to do without your file) and provide more detailed feedback.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I didn't say to delete it. The most important question is why is it there in the first place?

I'll see if I can figure out how to run your code (hard to do without your file) and provide more detailed feedback.
yes i agree it didnt need to be there , not sure how much more detail i can give .
Thanks for your help on this
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top