ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I input a warning message to remind the user to enter into. (https://www.excelbanter.com/excel-discussion-misc-queries/9861-how-do-i-input-warning-message-remind-user-enter-into.html)

sugarbrit17

How do I input a warning message to remind the user to enter into.
 
I am trying to create a spreadsheet where I require the user to enter data
into a certain cell. If they do not enter data in this cell I would like a
warning to pop up to remind them

Otto Moehrbach

You have to specify a trigger of some sort. IOW when do you want to check
if the user has made an entry in that cell? When he tries to save the file?
When he tries to print? When he accesses some other cell? When he enters
data into some other cell? HTH Otto
"sugarbrit17" wrote in message
...
I am trying to create a spreadsheet where I require the user to enter data
into a certain cell. If they do not enter data in this cell I would like
a
warning to pop up to remind them




tjtjjtjt

One way:
You could do it with an event macro.
Something like this could get you started:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1") = "" Then
MsgBox "Type a value in cell A1", vbInformation, "Value Missing"
End If
End Sub

This way of doing it will be fantastically annoying for anyone who leaves
the cell (in this case A1) blank.

To use this, right-click on the sheet tab you want the message to appear for
and choose View Code.
There will be a Drop-down with the word General in it. Change it to Worksheet.
Paste this:

If Range("A1") = "" Then
MsgBox "Type a value in cell A1", vbInformation, "Value Missing"
End If

into the middle of the lines that are already there.

If you aren't familiar with macros, check out:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

tj

"sugarbrit17" wrote:

I am trying to create a spreadsheet where I require the user to enter data
into a certain cell. If they do not enter data in this cell I would like a
warning to pop up to remind them


swisse

Make a macro in the Workbook_BeforeClose(), which checks if the user put some
data in cell A1. If none it puts a messagebox on the screen then it cancels
the closure of the workbook, until the user has put some data in A1. Here is
the code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If IsEmpty(Range("A1")) Then
MsgBox "Please enter data in A1."
Cancel = True
End If
End Sub

Swisse


All times are GMT +1. The time now is 03:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com