Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
not allow empty cells
I tried using Data, Validation for this, but couldn't get it to work. I need
to check a cell to ensure the value entered is between 0 and 60, but I also need to prevent the user from leaving the cell blank. -- Thank you, Maggie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
not allow empty cells
I think we need more info on how it is used.
Does the cell begin blank? And if so, when does the user confirm their 'final answer'? i.e. if they were to enter the cell, delete the contents and enter another cell before returning to the first to re-enter a figure, would this generate an error or be acceptable? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
not allow empty cells
try this pasted on the sheet code page and see if it works for you. i used
a4 in this example Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set rng = Range("a4") If rng.Value = "" Then MsgBox " You must enter a number" rng.Select End If If rng.Value < 0 Or rng.Value 60 Then MsgBox " you must enter a number between 0 and 60" rng.Select End If End Sub -- Gary "Maggie" wrote in message ... I tried using Data, Validation for this, but couldn't get it to work. I need to check a cell to ensure the value entered is between 0 and 60, but I also need to prevent the user from leaving the cell blank. -- Thank you, Maggie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
skipping empty cells that are not empty | Excel Programming | |||
Excel - Autom. Filter "Empty / Non Empty cells" should come first | Excel Discussion (Misc queries) | |||
How can I convert empty strings to empty cells? | Excel Discussion (Misc queries) | |||
macro to colour empty cells (cells not recognized as empty) | Excel Programming | |||
Can blank cells created using empty Double-Quotes not be empty?? | Excel Programming |