ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select rows contain Xin Column Y (https://www.excelbanter.com/excel-programming/282115-select-rows-contain-xin-column-y.html)

Hafeez Esmail

Select rows contain Xin Column Y
 
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

Tom Ogilvy

Select rows contain Xin Column Y
 
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.

--
Regards,
Tom Ogilvy

Hafeez Esmail wrote in message
...
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




Wei-Dong Xu [MSFT]

Select rows contain Xin Column Y
 
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.



Hafeez Esmail

Select rows contain Xin Column Y
 
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
-----Original Message-----
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.

--
Regards,
Tom Ogilvy

Hafeez Esmail wrote in message
...
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



.



All times are GMT +1. The time now is 10:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com