Select rows contain Xin Column Y

  • Thread starter Thread starter Hafeez Esmail
  • Start date Start date
H

Hafeez Esmail

I have a large amount data that gets dumped into a CSV
file every week where 40% of it is useless to me.
Sample data:
Column A = Date, Column B = Time, Column C = Division,
Column D = Group, E = Function etc..

The pseudocode for what I'd like to do is:
1) Select all rows that contain HR in Column C that
contain Hiring in column D OR Training in column D
2) Delete the selected rows

Thanks
Hafeez Esmail
 
You can do this with an autofilter

Select a cell in your data

do Data=>Filter=>Autofilter
in the dropdown in column C, select HR

in the dropdown in Column C, select custom, then equals Hiring or equals
Training.

Now select the entire data area except your header row and delete, entire
row.

Only the visible rows will be deleted. Now remove the Autofilter

Data=>filter=>Autofilter

If you want code, turn on the macro recorder before you do this manually.
Turn it off when done.

clean up the code to generalize it as necessary.
 
Hi Hafeez,

Thank you for posting in MSDN managed newsgroup!

I agree with Tom on this issue. You can filter these rows with the help of autofilter.

If you have any questions, please feel free to let me know!

Thank you for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks for the excellent suggestion Tom, I've made a lot
of progress on my macro.

I've hit a road block and have spent a lot of time trying
to over come it.
My date field is of category 'general' and will always
contian dates in the following format, "dd.MMM. YYYY" (the
space is there intentionally)

How do I filter all the dates (which I'll then be
removing) that are not between the most recent date and 5
days previous to the most recent date?

I'd appreciate any help you can give
Thanks

Hafeez Esmail
 
Back
Top