Like KazJaw, I suspect RegExp is probably the best bet; but I don't have enough experience with it either. So here's another approach:
Function TestEntry(sTest As String) As Boolean
Dim bTemp As Boolean
Dim sOKChars As String
Dim x As Long
bTemp = False ' by default
sOKChars = "!@#$%^&*()_+" ' add/remove chars as appropriate
If Len(sTest) > 1 Then
MsgBox "Doggone it, I said ONE character only. Try again."
' I'd remove the msgbox and test the Len before passing the
' string to this function, actually
End If
If 64 < Asc(sTest) And Asc(sTest) < 91 Then
bTemp = True
End If
If Not bTemp Then
For x = 1 To Len(sOKChars)
If Mid$(sOKChars, x, 1) = sTest Then
bTemp = True
Exit For
End If
Next
End If
TestEntry = bTemp
End Function
Sub TestTestEntry()
If TestEntry(",") Then
MsgBox "Ok"
Else
MsgBox "NOT ok"
End If
End Sub
inputboxin it? I'm asking to provide more accurate suggestion...RegExpin your situation. There are plenty of examples here in SO. I don't have enough experience with that to help you more but you could start with this link