Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
skipping empty cells that are not empty quizkiwi[_4_] Excel Programming 3 October 3rd 05 06:59 PM
Excel - Autom. Filter "Empty / Non Empty cells" should come first Rom Excel Discussion (Misc queries) 0 August 10th 05 04:32 PM
How can I convert empty strings to empty cells? Shane Excel Discussion (Misc queries) 2 July 19th 05 12:10 PM
macro to colour empty cells (cells not recognized as empty) Gerben Excel Programming 5 June 30th 05 03:29 PM
Can blank cells created using empty Double-Quotes not be empty?? JohnI in Brisbane Excel Programming 6 September 7th 03 11:22 PM


All times are GMT +1. The time now is 04:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"