Home |
Search |
Today's Posts |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Validation - e-mail
Hi,
You could right click the sheet tab, view code and paste this in. If an invalid emal address is entered in the range A1 - a10 (Change to suit) you get a popup warning Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub If Not Intersect(Target, Range("A1:A10")) Is Nothing Then Dim RE As Object Set RE = CreateObject("vbscript.REgExp") RE.Pattern = "^[a-zA-Z0-9\._-]+@([a-zA-Z0-9_-]+\.)+([a-zA-Z]{2,3})$" If RE.test(Target.value) = False Then MsgBox "Invalid email in " & Target.Address End If Set RE = Nothing End If End Sub Mike "Theo" wrote: I want to be sure that the entry into a cell is an email address - is there a way to ensure that at least one character (any character) is an at sign (@). Any ideas appreciated!!!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
E-Mail attachment to same e-mail address in Outlook | Excel Discussion (Misc queries) | |||
Validation on E-mail address | Excel Worksheet Functions | |||
E-mail macro - Field Validation | Excel Discussion (Misc queries) | |||
Error: cannot load the mail service. Check your mail installation. | Excel Discussion (Misc queries) | |||
General mail failure when sending e-mail from Excel | Excel Discussion (Misc queries) |