View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default extracting data in an array

Do you want VBA code?

Sub Eliminaterows()
Dim lastrow as Long, i as Long
lastrow = cells(rows.count,3).end(xlup).row
for i = lastrow to 1 step -1
if lcase(cells(i,1)) < "task" or cells(i,3)="" then
rows(i).EntireRow.delete
end if
next
EndSub

Test this on a copy of your data to make sure it works.

--
Regards,
Tom Ogilvy


" wrote:

Hello fellow excel users...

I have a question on using vba to extract data from an array. Okay,
here's the scenario...

A B C
1 Task Deliver drawings 6/20/2007
2 General Note Did some things
3 General Note Finished some things
4 Task Order new drawings 6/21/2007
5 Task Finish drawings 6/22/2007
6 Phone Call Talked with Bill
7 Task Finish project 6/25/2007

A1:A7 are strings (obviously), as are B1:B7. There will not be any
dates in the rows that are NOT titled "Task". What I want to do is
have VBA extract the rows titled "Task" (including their subject and
date) and put them in a new column. Or something to that effect so
that when the code is run, what will be left is this...

Task Deliver drawings 6/20/2007
Task Order new drawings 6/21/2007
Taks Finish drawings 6/22/2007
Taks Finish project 6/25/2007

If it's possible, the rows with General Note and Phone Call can be
eliminated so that only rows with Task are left is fine. I didn't
know if sorting a new list or just eliminating rows would be easier.
Anyway, this is what I need and I don't know how to do that. Can
anyone help? Thanks.