Message Box on Input

S

Seanie

How can I create a Message Box that Pops up when a value entered in a
Cell is greater than 0? This this box should display for 5 seconds
without the user being able to exit from it. Is this possible?

I don't wish to use the display message within Data Validation for
this

Thanks
 
M

Mike H

Hi,

This will display a message box for 5 seconds if a value > 0 is entered in
A1. I don't know how to make it appear without an OK button, perhaps someone
will show us how. Right click your sheet tab, view code and paste the code in.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$A$1" Or _
Target.Value = 0 Or _
Not IsNumeric(Target) Then Exit Sub
Dim Msg As String
Dim Secs As Long
Dim Wsh As Object
Title = "A Message Box"
Msg = "This will close in 5 seconds."
Secs = 5
Set Wsh = CreateObject("WScript.Shell")
RetVal = Wsh.Popup(Msg, Secs, Title, vbExclamation)
Set Wsh = Nothing
End Sub

Mike
 
D

dk

How can I create a Message Box that Pops up when a value entered in a
Cell is greater than 0? This this box should display for 5 seconds
without the user being able to exit from it. Is this possible?

I don't wish to use the display message within Data Validation for
this

Thanks

You can do this, provided you are not using the built in MSG BOX.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top