View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Looking for "Select where in" type function

Something like this
Sub trythis()
mc = 1 'column A
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
dlr = Sheets("sheet3").Cells(Rows.Count, "a").End(xlUp).Row + 1
Select Case Cells(i, mc)
Case Is = "a", "b"
Rows(i).Delete
Case Is = "c", "d", "e"
Cells(i, mc).Copy Sheet("sheet3").Cells(dlr, "a")
Rows(i).Delete
Case Else
End Select
Next i
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"randy.buchholz" wrote in message
...
Hi Group,
I'm trying to work with some log files and have been directed to do this
in Excel. I'm mostly a DB guy and usually only use Excel 2007 for preping
data for a DB load, I need your help please.
The log files are just lines in a text file. In excel I have one column
with a row for each log entry.
I need to perform two processing steps on this data, both using something
like a "Select where in" SQL function.
I have two lists. The first list has "good" items like "Record Inserted".
The Second list is a list of "bad" key words; like "Error" or "Warning.
What I am trying to do step throught the column, processing each row. (I
know how to navigate, but the processing is the issue)
The rules for each row/cell a
1) If the cell value exactly matches any "Good" value, the row is deleted.
2) If the cell contains any of the words in the "Bad" list, the cell
content is moved (to another sheet?) and the row is deleted from the log.
These rules are applied is this order. Remaining rows are untouched.
Any help would be appreciated,
Thanks