Show a msgbox if value is entered
noemarto
-
jordane45 Posted messages 30426 Registration date Status Moderator Last intervention -
jordane45 Posted messages 30426 Registration date Status Moderator Last intervention -
Hello,
I've been pulling my hair out over a seemingly simple problem for a while now.
In an Excel file, I would like a popup window to appear as soon as a certain value is entered.
For example, when I enter something in my "LE PHARO" sheet, a window opens with some text and an OK button.
Thank you for your help ^^
Configuration: Windows 7 / Chrome 51.0.2704.106
I've been pulling my hair out over a seemingly simple problem for a while now.
In an Excel file, I would like a popup window to appear as soon as a certain value is entered.
For example, when I enter something in my "LE PHARO" sheet, a window opens with some text and an OK button.
Thank you for your help ^^
Configuration: Windows 7 / Chrome 51.0.2704.106
2 answers
-
Hello,
To detect the entry of text in a sheet, you can look at the method: Worksheet_Change
An IF to compare with the desired text
A msgbox to display your window
In summary:Private Sub Worksheet_Change(ByVal Target As Range) Dim ok If Target.Value = "LE PHARO" Then ok = MsgBox("some text", vbOKOnly, "a title for the window") End If End Sub
--
Best regards,
Jordane -
Hello,
Thank you for your help. It works well, however an error window appears when I delete the text:
Runtime error '13'
Type mismatch
Is there a solution?
Best regards,
Noëmie-
I can't reproduce the issue ....
Can you tell us exactly what you do when it crashes?
Also, check on which line of code it shows the error
If necessary, you can possibly send us your file (removing confidential data) on the site cijoint.com: https://www.commentcamarche.net/faq/29493-utiliser-cjoint-pour-heberger-des-fichiers
.
-