+ Reply to Thread
Results 1 to 2 of 2

IF not numbers delete

  1. #1
    Registered User
    Join Date
    12-10-2003
    Location
    burbank
    Posts
    2

    IF not numbers delete

    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.

  2. #2
    Bob Phillips
    Guest

    Re: IF not numbers delete

    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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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...fo&userid=3704
    > View this thread: http://www.excelforum.com/showthread...hreadid=494355
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1