how can I set a cell so that you can only type in 1 , 2 , 3, 4, 5
I know I can use the validation but people can just copy a cell and paste it over.
how can I set a cell so that you can only type in 1 , 2 , 3, 4, 5
I know I can use the validation but people can just copy a cell and paste it over.
Under allow > select whole numbers
Min 1
Max 5
VBA Noob
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Either you can set up a validation (as you mentioned) AND protect your worksheet to prevent people from copying/pasting over the validation, or you can use VBA (if you don't mind that) to prevent people from entering an incorrect value.
Sorry
Misread the question.
See if link helps
http://www.j-walk.com/ss/excel/tips/tip98.htm
VBA Noob
Or a event macro. Right click sheet > select view code and paste in the below. Change range as required
VBA Noob![]()
Please Login or Register to view this content.
Sorry where can I specify allow ?
See link point 3.
http://www.contextures.com/xlDataVal01.html#Apply
VBA Noob
HOW CAN I ADPAT THIS SO THAT Z3:Z500 IS RESTRICTED TO 1 , 2 OR 3 AS WELL AS THE ABOVE.![]()
Please Login or Register to view this content.
Change to
VBA Noob![]()
Please Login or Register to view this content.
This is just a minor change to VBA Noob's code to disallow decimal numbers from being used in place of whole numbers:
![]()
Please Login or Register to view this content.
Khalid, you need to combine them into one procedure:
![]()
Please Login or Register to view this content.
Try
VBA Noob![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
If Target.Value > 3 Or Target.Value <> Int(Target.Value) Then
how do I change >3 to between 3 and 5 ie 3,4,5
anybody out there ?
Try this code and report back:
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks