Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I can't seem to get that either. I'm still trying though. What do you think
about this code? Only prob is that I can't get it for the entire column. Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo OuttaHere If Target.Address = "$F$4" Then '<<<< change cell Application.EnableEvents = False Dim strText As String Dim lngN As Long Const str_Chars As String = "[0-9a-zA-Z ]" strText = Target.Text For lngN = 1 To Len(strText) If Not Mid$(strText, lngN, 1) Like str_Chars Then MsgBox "Only numbers or alphabetic characters allowed. ", _ vbOKOnly, "Data Validation" Application.Undo Exit For End If Next 'lngN End If OuttaHe Application.EnableEvents = True End Sub "Kimberly" wrote: Can anyone help me validate a column to allow only text and spaces. No punctuation. I used this below and was able to get only text but it also prevents spaces. =SUMPRODUCT(--(ISNUMBER(MATCH(CODE(MID(A1,ROW(INDIRECT("1:"&LEN( A1))),1)),ROW(INDIRECT("97:122")),0))))+SUMPRODUCT (--(ISNUMBER(MATCH(CODE(MID(A1,ROW(INDIRECT("1:"&LEN( A1))),1)),ROW(INDIRECT("65:90")),0))))=LEN(A1) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data validation | Excel Worksheet Functions | |||
Macro question | Excel Worksheet Functions | |||
Inputting data to one worksheet for it effect another | Excel Discussion (Misc queries) | |||
named range, data validation: list non-selected items, and new added items | Excel Discussion (Misc queries) | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions |