PC Review


Reply
Thread Tools Rate Thread

Deleting Duplicate Rows containing a value matching with a value f

 
 
emil
Guest
Posts: n/a
 
      1st Jun 2009
Delete Duplicate Rows containing more values matching with a value from a
cell located in other Range.
I searched the answer on Site http: Www. Cpearson.com Excel distinctvalues.
Aspx, as well as in another questions from this forum but I did not found the
answer.
Thanks for any helps
Emil

 
Reply With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      2nd Jun 2009
the key is how do you define a duplicate row?
i already answered a similar question.
my method was to add a key column which was the concatenated values of 10
columns. then we removed lines where we had duplicate keys.

think on this approach


"emil" <(E-Mail Removed)> wrote in message
news:8239444A-546B-461B-AB5C-(E-Mail Removed)...
> Delete Duplicate Rows containing more values matching with a value from a
> cell located in other Range.
> I searched the answer on Site http: Www. Cpearson.com Excel
> distinctvalues.
> Aspx, as well as in another questions from this forum but I did not found
> the
> answer.
> Thanks for any helps
> Emil
>

 
Reply With Quote
 
emil
Guest
Posts: n/a
 
      2nd Jun 2009
Hello
Patrick Molloy

Thank very much for your answer.
Delete Duplicate Rows
I believe that my question was not clear.
Here is an e.g.
I have a column (“F: F”) with the values as strings:
Range (“F1”).value = “Str1”
Range (“F2”).value = “Str1”
Range (“F3”).value = “Str1”
Range (“F4”).value = “Str1”
Range (“F5”).value = “Str2”
Range (“F6”).value = “Str3”
Range (“F7”).value = “Str3”
Range (“F8”).value = “Str3”

- At the first running of procedure, Cell (“A1”) has, the value “Str1”, and
I will to erase the rows, which has the duplicates as “Str1” in column (“F:
F”).
- At the second running of procedure, the value in Cell (“A1”) changed to
“Str2”. Because I have no duplicates in column (“F: F”) for “Str2”, do not
erased any rows.
- At the third running of procedure, the value in Cell (“A1”) changed to
“Str3” and I will to erase the rows, which has the duplicates as “Str3” in
column (“F: F”).
And so on, systematically.
How can I do this?
I thank once again for granted time!
Emil.


"Patrick Molloy" wrote:

> the key is how do you define a duplicate row?
> i already answered a similar question.
> my method was to add a key column which was the concatenated values of 10
> columns. then we removed lines where we had duplicate keys.
>
> think on this approach
>
>
> "emil" <(E-Mail Removed)> wrote in message
> news:8239444A-546B-461B-AB5C-(E-Mail Removed)...
> > Delete Duplicate Rows containing more values matching with a value from a
> > cell located in other Range.
> > I searched the answer on Site http: Www. Cpearson.com Excel
> > distinctvalues.
> > Aspx, as well as in another questions from this forum but I did not found
> > the
> > answer.
> > Thanks for any helps
> > Emil
> >

 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      2nd Jun 2009
if the values in F are sorted, then starting at the bottom, ie the
highest/largest row number , if the data in the cell in the next lower row
matches , then delete the row


for rw = range("F1").End(xlDown).Row to 2 step -1
if cells(rw,"F")=cells(rw-1,"F") then
rows(rw),delete
end if
next


"emil" <(E-Mail Removed)> wrote in message
news:1D832055-F84E-436A-B6F1-(E-Mail Removed)...
> Hello
> Patrick Molloy
>
> Thank very much for your answer.
> Delete Duplicate Rows
> I believe that my question was not clear.
> Here is an e.g.
> I have a column (“F: F”) with the values as strings:
> Range (“F1”).value = “Str1”
> Range (“F2”).value = “Str1”
> Range (“F3”).value = “Str1”
> Range (“F4”).value = “Str1”
> Range (“F5”).value = “Str2”
> Range (“F6”).value = “Str3”
> Range (“F7”).value = “Str3”
> Range (“F8”).value = “Str3”
>
> - At the first running of procedure, Cell (“A1”) has, the value “Str1”,
> and
> I will to erase the rows, which has the duplicates as “Str1” in column
> (“F:
> F”).
> - At the second running of procedure, the value in Cell (“A1”) changed to
> “Str2”. Because I have no duplicates in column (“F: F”) for “Str2”, do not
> erased any rows.
> - At the third running of procedure, the value in Cell (“A1”) changed to
> “Str3” and I will to erase the rows, which has the duplicates as “Str3” in
> column (“F: F”).
> And so on, systematically.
> How can I do this?
> I thank once again for granted time!
> Emil.
>
>
> "Patrick Molloy" wrote:
>
>> the key is how do you define a duplicate row?
>> i already answered a similar question.
>> my method was to add a key column which was the concatenated values of 10
>> columns. then we removed lines where we had duplicate keys.
>>
>> think on this approach
>>
>>
>> "emil" <(E-Mail Removed)> wrote in message
>> news:8239444A-546B-461B-AB5C-(E-Mail Removed)...
>> > Delete Duplicate Rows containing more values matching with a value from
>> > a
>> > cell located in other Range.
>> > I searched the answer on Site http: Www. Cpearson.com Excel
>> > distinctvalues.
>> > Aspx, as well as in another questions from this forum but I did not
>> > found
>> > the
>> > answer.
>> > Thanks for any helps
>> > Emil
>> >

 
Reply With Quote
 
emil
Guest
Posts: n/a
 
      2nd Jun 2009
Thank you very much.
It is great. Works!
Thank you
Emil
"Patrick Molloy" wrote:

> if the values in F are sorted, then starting at the bottom, ie the
> highest/largest row number , if the data in the cell in the next lower row
> matches , then delete the row
>
>
> for rw = range("F1").End(xlDown).Row to 2 step -1
> if cells(rw,"F")=cells(rw-1,"F") then
> rows(rw),delete
> end if
> next
>
>
> "emil" <(E-Mail Removed)> wrote in message
> news:1D832055-F84E-436A-B6F1-(E-Mail Removed)...
> > Hello
> > Patrick Molloy
> >
> > Thank very much for your answer.
> > Delete Duplicate Rows
> > I believe that my question was not clear.
> > Here is an e.g.
> > I have a column (“F: F”) with the values as strings:
> > Range (“F1”).value = “Str1”
> > Range (“F2”).value = “Str1”
> > Range (“F3”).value = “Str1”
> > Range (“F4”).value = “Str1”
> > Range (“F5”).value = “Str2”
> > Range (“F6”).value = “Str3”
> > Range (“F7”).value = “Str3”
> > Range (“F8”).value = “Str3”
> >
> > - At the first running of procedure, Cell (“A1”) has, the value “Str1”,
> > and
> > I will to erase the rows, which has the duplicates as “Str1” in column
> > (“F:
> > F”).
> > - At the second running of procedure, the value in Cell (“A1”) changed to
> > “Str2”. Because I have no duplicates in column (“F: F”) for “Str2”, do not
> > erased any rows.
> > - At the third running of procedure, the value in Cell (“A1”) changed to
> > “Str3” and I will to erase the rows, which has the duplicates as “Str3” in
> > column (“F: F”).
> > And so on, systematically.
> > How can I do this?
> > I thank once again for granted time!
> > Emil.
> >
> >
> > "Patrick Molloy" wrote:
> >
> >> the key is how do you define a duplicate row?
> >> i already answered a similar question.
> >> my method was to add a key column which was the concatenated values of 10
> >> columns. then we removed lines where we had duplicate keys.
> >>
> >> think on this approach
> >>
> >>
> >> "emil" <(E-Mail Removed)> wrote in message
> >> news:8239444A-546B-461B-AB5C-(E-Mail Removed)...
> >> > Delete Duplicate Rows containing more values matching with a value from
> >> > a
> >> > cell located in other Range.
> >> > I searched the answer on Site http: Www. Cpearson.com Excel
> >> > distinctvalues.
> >> > Aspx, as well as in another questions from this forum but I did not
> >> > found
> >> > the
> >> > answer.
> >> > Thanks for any helps
> >> > Emil
> >> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Duplicate Rows =?Utf-8?B?SmFzZTRub3c=?= Microsoft Excel Programming 2 18th Sep 2007 08:18 AM
Deleting duplicate rows =?Utf-8?B?S2V2aW4=?= Microsoft Excel Misc 1 2nd May 2006 12:16 AM
Deleting Duplicate Rows =?Utf-8?B?Uk1vcnQ=?= Microsoft Excel Programming 5 26th Apr 2005 09:43 PM
Deleting Duplicate Rows AllenR2 Microsoft Excel Programming 4 11th Sep 2004 06:01 PM
deleting duplicate rows =?Utf-8?B?SmVubmlmZXI=?= Microsoft Excel Misc 1 13th Apr 2004 10:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:11 PM.