Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Need help in deleting specific data.


Hi there
Can anyone help. I am looking for a macro or someway that I can delete
data out of a workbook that dont contain specific data. If in column E
it dont say one of the following Nhampton, euston, tring, bletchley,
Nhamp Emd, Nhamp NJ, Nhamptn RS, Watford Jn, Bltchly MD, Bedford,
Bletch CS or M keynes I need the row totally deleted.
This will be all the way down the workbook until the last entry.

Can anyone help.




--
tweacle
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Need help in deleting specific data.


Dont know if anyone can help me on this.
Ive managed to get a macro but its deleting the wrong way round.


Sub TRY()
Dim c As Range
Dim x(), j, fo As String
Dim i As Integer
x = Array("Nhampton", "euston", "tring", "bletchley", "Nhamp Emd",
"Nhamp NJ", "Nhamptn RS", "Watford Jn", "Bltchly MD", "Bedford",
"Bletch CS", "M keynes")
For i = LBound(x) To UBound(x)
Set c = Range("E:E").Find(x(i), LookIn:=xlValues, Lookat:=xlWhole)
If c Is Nothing Then GoTo nxt
fo = c.Address
Do Until j = fo
Set c = Range("E:E").FindNext(After:=c)
j = c.Address
Range(j).EntireRow.ClearContents
Loop
nxt:
Next
Range("E:E").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
End Sub

What im trying to do is where the data in column "E" says Northampton
etc as shown above I need to KEEP IT and not delete, but delete
everything else.
Just one other thing I forgot to mention was that if the cell is blank
in column E could the macro poss ignore this cell.

Thanks




--
tweacle
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
Deleting a Row if it contains a specific word Steve Madsen Excel Discussion (Misc queries) 1 February 1st 07 09:58 PM
Deleting rows with specific values whatzzup Excel Discussion (Misc queries) 1 July 6th 06 10:35 AM
Deleting row with specific value Jed Excel Discussion (Misc queries) 2 January 12th 06 01:59 PM
Deleting specific records [email protected] Excel Discussion (Misc queries) 6 June 22nd 05 11:35 PM
Deleting Specific Rows ScaffoldingDepot Excel Discussion (Misc queries) 2 May 4th 05 04:08 PM


All times are GMT +1. The time now is 07:16 AM.

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"