View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RJB RJB is offline
external usenet poster
 
Posts: 86
Default Extracting Rows of Information Based on Value of One Column

I have a gi-normous list of info that gets imported from an outside database.

One of the columns - in the middle of the dang thing - is the "Event Date".

Sometimes I want to look at all the information related to events on a
specific day.

So what I'd like to do is:
- Create a cell - let's call it $A$2 - that has my "Desired Date" in it.
- Run a macro that deletes all rows that are NOT the date specified in cell
$A$2.

I have seen macros that use "ActiveCell" to accomplish this... But I want
for it literally to navigate to the right column on its own and do this.

In other words, I want the user to - no matter which cell they're in - click
on the macro button, and have Excel:
- Go to the first "Date" field (which on the first iteration will be $G4).
- Compare it to the "Desired Date" ($A$2).
- If it doesn't match, delete the whole row, and go to the next.
- If it DOES match, go down one row and do the comparison again.

There will be multiple entries for one date, so it will need to stop, think,
make a decision, and then go on.

There are also multiple dates in each row, so I can't just do a "For Each"
either.

(And also I will need the loop to stop when it runs out of rows... So how
would I tell it to "Do Until" column G is done?)

Thoughts?

(OK, more specific, "SIMPLE Thoughts?")

Thank you,

rjb