Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Just use data validation like this: Sub NumberVal() Range("A1:D10").Select With Selection.Validation ..Delete ..Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, _ Operator:=xlLessEqual, Formula1:="7" ..IgnoreBlank = True ..InCellDropdown = True ..InputTitle = "" ..ErrorTitle = "Invalid Data Entry" ..InputMessage = "" ..ErrorMessage = "You must enter a number either 7 or below!" ..ShowInput = True ..ShowError = True End With End Sub Change the range to suit! regards, Simon -- Simon Lloyd ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708 View this thread: http://www.excelforum.com/showthread...hreadid=571414 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error Alert for Invalid Data doesn't work for data selected in col | Excel Worksheet Functions | |||
Cleanout invalid data | Excel Discussion (Misc queries) | |||
How to create a MsgBox to alert user an invalid entry has been mad | Excel Programming | |||
Data Validation: Printing Invalid Data Circles | Excel Discussion (Misc queries) | |||
MsgBox "Invalid property value" | Excel Programming |