data validation

hawley

Board Regular
Joined
Apr 7, 2002
Messages
197
In a cell I have data validation that only a X can be entered. The wierd thing is that I can enter in an "*" or "X" and it accepts it. Although it should not accept the "*". One more wierd thing is that it will accept a "X*" or a "*X". Does anyone know why this is?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
if you're just using list with a plain and simple x in the source box, this should not be happening. You're not pasting (as opposed to typing) this in, are you?
This message was edited by IML on 2002-05-02 13:49
 
Upvote 0
I'm stumped then. I was thinking if you were using a formula under custom as opposed to a list, you may run into some problems as the asterick is a wildcard character. At least you've ruled two things out... good luck
 
Upvote 0
Hello Hawley

I tried it in excel 2000 and , yes it happens.
Maybe the * is a kind of wild character and excel ignores validation
I will work on it more

Andreas
 
Upvote 0
The change event will refuse anything but an X in cell A1. Edit to the correct address...

<pre>
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Not Target = "X" Then
MsgBox "Please enter an 'X'", , "Invalid Entry"
Application.EnableEvents = False
Target.Select
Application.EnableEvents = True
Exit Sub
End If
End If
End Sub

</pre>
Tom
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top