Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like this code to validate the data for all of column F - any
suggestions? 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If data in one column, take date, add 2 days, and turn the entire column a color... | Excel Discussion (Misc queries) | |||
my column is sorted in two sections. How do I sort entire column? | Excel Discussion (Misc queries) | |||
my column is sorted in two sections. How do I sort entire column? | Excel Discussion (Misc queries) | |||
Find Column heading and then Delete entire column | Excel Programming | |||
Code for deleting entire row | Excel Programming |