ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find & Delete Rows (https://www.excelbanter.com/excel-programming/332062-find-delete-rows.html)

Steve Wallis

Find & Delete Rows
 
I have never written a Vba script. If there is a more appropriate forum for
me, please point me to it. If you are able to help here, please do so in
explicit step by step form. I found what appear to be answers on Google, ran
a simple macro, then tried to copy and paste the answers into my macro -
didn't work.

There are 2 problems, which (I think) are similar. They will be in different
workbooks and unrelated.

1) I have a column full of either "a" or "b". I want to find every "b" value
and delete the entire row it's in.

2) A workbook has names in one column, some of which are duplicated,
sometimes repeated 3 or 4 times. I want to retain the first row with each
name and delete rows with duplicates.

Any assistance is very much appreciated

Steve Wallis

(Change yahoo to bigpond)



Norman Jones

Find & Delete Rows
 
Hi Steve,

1) I have a column full of either "a" or "b". I want to find every "b"
value and delete the entire row it's in.


Use Data | Filter | AutoFilter and set the filter criterion to 'b' and
simply delete the filtered rows.

If you are not familiar with the Autofilter feature, see Debra Dalgleish's
excellent tutorial (replete with informative screenshots) at:

http://www.contextures.com/xlautofilter01.html


2) A workbook has names in one column, some of which are duplicated,
sometimes repeated 3 or 4 times. I want to retain the first row with each
name and delete rows with duplicates.


In this case, use the Advanced filter feature, selecting the *Unique
Records* option.
Debra Dalgleish also has a similarly excellent tutorial on Advanced Filters
at:

http://www.contextures.com/xladvfilter01.html

Finally, If you have a reason for wanting to accomplish these tasks using
VBA, please post back.

---
Regards,
Norman



"Steve Wallis" wrote in message
...
I have never written a Vba script. If there is a more appropriate forum for
me, please point me to it. If you are able to help here, please do so in
explicit step by step form. I found what appear to be answers on Google,
ran a simple macro, then tried to copy and paste the answers into my
macro - didn't work.

There are 2 problems, which (I think) are similar. They will be in
different workbooks and unrelated.

1) I have a column full of either "a" or "b". I want to find every "b"
value and delete the entire row it's in.

2) A workbook has names in one column, some of which are duplicated,
sometimes repeated 3 or 4 times. I want to retain the first row with each
name and delete rows with duplicates.

Any assistance is very much appreciated

Steve Wallis

(Change yahoo to bigpond)




Steve Wallis

Find & Delete Rows
 
Thanks Norman. Both solutions work beautifully and no, I've no particular
wish to get involved in VBA if it is avoidable.


Steve


"Norman Jones" wrote in message
...
Hi Steve,

1) I have a column full of either "a" or "b". I want to find every "b"
value and delete the entire row it's in.


Use Data | Filter | AutoFilter and set the filter criterion to 'b' and
simply delete the filtered rows.

If you are not familiar with the Autofilter feature, see Debra Dalgleish's
excellent tutorial (replete with informative screenshots) at:

http://www.contextures.com/xlautofilter01.html


2) A workbook has names in one column, some of which are duplicated,
sometimes repeated 3 or 4 times. I want to retain the first row with each
name and delete rows with duplicates.


In this case, use the Advanced filter feature, selecting the *Unique
Records* option.
Debra Dalgleish also has a similarly excellent tutorial on Advanced
Filters at:

http://www.contextures.com/xladvfilter01.html

Finally, If you have a reason for wanting to accomplish these tasks using
VBA, please post back.

---
Regards,
Norman



"Steve Wallis" wrote in message
...
I have never written a Vba script. If there is a more appropriate forum
for me, please point me to it. If you are able to help here, please do so
in explicit step by step form. I found what appear to be answers on
Google, ran a simple macro, then tried to copy and paste the answers into
my macro - didn't work.

There are 2 problems, which (I think) are similar. They will be in
different workbooks and unrelated.

1) I have a column full of either "a" or "b". I want to find every "b"
value and delete the entire row it's in.

2) A workbook has names in one column, some of which are duplicated,
sometimes repeated 3 or 4 times. I want to retain the first row with each
name and delete rows with duplicates.

Any assistance is very much appreciated

Steve Wallis

(Change yahoo to bigpond)







All times are GMT +1. The time now is 12:07 AM.

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