Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
djranks
 
Posts: n/a
Default 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.


--
djranks
------------------------------------------------------------------------
djranks's Profile: http://www.excelforum.com/member.php...fo&userid=3704
View this thread: http://www.excelforum.com/showthread...hreadid=494355

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default 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" wrote in
message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I delete numbers in a cell Therese Excel Discussion (Misc queries) 2 December 1st 05 10:22 AM
Sorting Numbers w/Aplha Suffix Moonray80 Excel Discussion (Misc queries) 5 November 21st 05 07:04 AM
Checking Winning Numbers in the Lottery. Ann Excel Discussion (Misc queries) 4 May 18th 05 10:55 AM
Averaging Numbers when 2 numbers in one cell Ourania Excel Worksheet Functions 8 January 12th 05 06:40 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 10:19 PM


All times are GMT +1. The time now is 06:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"