Please help with removing duplicates with vba

tolga

New Member
Joined
May 27, 2015
Messages
17
Hello all,

This is my first post and I have been using this website for a few months now, but never officially. Today is my first official post. I would like to thank all that have helped me so much so far, without knowing. This site is truly a gem. Anyway, I have a problem that I can't seem to figure out. I'm really new with macros and I have yet to create something from scratch. I have been able to get by so far by putting things together that I have seen from other people. This is what I have and I would really appreciate any help. I hope it posts correctly. I have, on the left side series x with values 1 2 3 4 5 6 and it repeats itself a few times. I have series Y with certain values 1 2 3 etc and finally Z with similar values. Both Y and Z can repeat. How can I create a macro say for Column B to take those series in column B and remove the duplicates of the series X, Y and Z leaving only one of each series with one set of their relative values for Column C? Thank you so much in advance for the help. :)
Code:
X		X
1		1
2		2
3		3
4		4
5		5
6		6
Y		Y
1		1
2		2
3		3
4		4
Z		Z
1		1
2		2
X		
1		
2		
3		
4		
5		
6		
Y		
1		
2		
3		
4
 
Hi Tolga welcome to the Board :D

i don't know if its imperative for you to use VBA or you could not find another reasonable solution for this.

But the simplest way to do it in 2013 is

Click the "Data tab" go to the middle section "data tools" and select Remove Duplicates.

 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi Tolga welcome to the Board :D

i don't know if its imperative for you to use VBA or you could not find another reasonable solution for this.

But the simplest way to do it in 2013 is

Click the "Data tab" go to the middle section "data tools" and select Remove Duplicates.

....

.. Hi. Thanks for the imput, gut to know. I also appear, on looking just now, to have this function from XL 2007.

. However if I am not mistaken this simply removes duplicates in a list, so for the OPs case he would get this..

..
Using Excel 2007
-
A
2
type1
3
apples
4
oranges
5
pears
6
type2
7
bear
8
lube

<tbody>
</tbody>
Toga

<tbody>
</tbody>


.. he was after something completely different...

Using Excel 2007
-
G
2
type1
3
apples
4
oranges
5
pears
6
type2
7
apples
8
apples
9
apples
10

<tbody>
</tbody>
Toga

<tbody>
</tbody>

. But thanks for the Tip. I did not know of this simplel possibility to remove duplicates in a Spreadsheet list.

Alan
 
Last edited:
Upvote 0
oooops hahaha i honestly didn't read trough the whole thing and i mistakenly assumed that's that the OP needed. boy is my face red hehehe
 
Upvote 0
Hi,

Lesson 2 in Posting at Mr Excel

. It is a good idea usually to reply with the „Reply With Quote“ Button . That way everyone keeps track of who is talking to who. ( Some Board Regulars do not do that and it is a pain sometimes keeping track of who is answering who and in / to which Post. So you should usually Always do it and always include a bit of the original message, …..

What is wrong with just putting @DocAElstein to show who you are replying to and then just using quote when you need to post an excerpt of a quote which saves board space and makes the thread shorter and easier to read?
 
Upvote 0
What is wrong with just putting @DocAElstein to show who you are replying to and then just using quote when you need to post an excerpt of a quote which saves board space and makes the thread shorter and easier to read?

... Nothing wrong with that! - Another alternative, if nothing is needed in a quote! :)
 
Upvote 0

Forum statistics

Threads
1,214,872
Messages
6,122,026
Members
449,061
Latest member
TheRealJoaquin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top