Re: IF not numbers delete
- From: "Bob Phillips" <bob.phillips@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 17 Dec 2005 17:36:33 -0000
Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim oRegEx As Object
Set oRegEx = CreateObject("VBScript.RegExp")
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row1
With oRegEx
.Pattern = "^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
For i = iLastRow To 1 Step -1
If Not .Test(Cells(i, "A").Value) Then
Rows(i).Delete
End If
Next i
End With
Set oRegEx = Nothing
End Sub
--
HTH
RP
(remove nothere from the email address if mailing direct)
"djranks" <djranks.20722m_1134839401.6391@xxxxxxxxxxxxxxxxxxxxx> wrote in
message news:djranks.20722m_1134839401.6391@xxxxxxxxxxxxxxxxxxxxxxxx
>
> i have a list of 25,000 entries which are email addresses. how can i
> check for invalid inputs like bogus numbers. Maybe like if cell
> includes numbers or not email address delete row type formula.
>
>
> --
> djranks
> ------------------------------------------------------------------------
> djranks's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=3704
> View this thread: http://www.excelforum.com/showthread.php?threadid=494355
>
.
- References:
- IF not numbers delete
- From: djranks
- IF not numbers delete
- Prev by Date: IF not numbers delete
- Next by Date: Re: compressing files
- Previous by thread: IF not numbers delete
- Next by thread: Re: I put a Calc. in to get a total IE =K12 the answer comes up as 0
- Index(es):
Relevant Pages
|