get unique records using advanced filter from VBA

macro_user

Board Regular
Joined
Mar 9, 2009
Messages
101
hi...
i need to use the advance filter=>unique records only feature from my macro... how would i do tat? i have 3 columns... column A has records which are repeated... column B and column C's values for a corresponding column A's value are the same...
A B C
a 3 6
b 4 7
c 8 9
d 1 2
a 3 6
b 4 7
.... and so on...
i need to use tat feature so tat i can filter column A alone and then copy column A, column B and column C's value to columns E,F and G...
kindly help me out on this...
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
wat i need is to get a unique value in column A with its corresponding values in column B and C... i do not mind if its using the in-built advanced filter option or its a piece of code... but i need to do this from my macro...
 
Upvote 0
hi...
i need to use the advance filter=>unique records only feature from my macro... how would i do tat? i have 3 columns... column A has records which are repeated... column B and column C's values for a corresponding column A's value are the same...
A B C
a 3 6
b 4 7
c 8 9
d 1 2
a 3 6
b 4 7
d 1 2
c 8 9
.... and so on...
i need to use tat feature so tat i can filter column A alone and then copy column A, column B and column C's value to columns E,F and G...
kindly help me out on this...

i need :
A B C
a 3 6
b 4 7
c 8 9
d 1 2... and so on...
 
Upvote 0
The best way do get a start on the code would be to use the macro recorder when you do it manually.

I tried that and this is what I got.
Code:
    Range("A1:C9").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
 
Last edited:
Upvote 0
The best way do get a start on the code would be to use tje macro recorder when you do it manually.

I tried that and this is what I got.
Code:
    Range("A1:C9").AdvancedFilter Action:=xlFilterInPlace, Unique:=True

yaa... actually i tried somethin like this... but i tried selecting only column A and doing advanced filter... then, column A gives unique values but when i try to copy column B and C, the corresponding values aren't getting copied... let me try selecting the entire range and then doing advanced filter... Thanks!
 
Upvote 0
No... i just tried wat you said and it dint work... when i do Advanced Filter on after selecting columns A, B and C, i'm getting the proper values... but when i copy it and paste these 3 columns into the adjacent 3 columns, then im not getting the proper values.... its like the copy and paste is not proper... its missing few records in between... Has anyone had any such problem with Advanced filter?
 
Upvote 0
why not use the Copy to another location option?:)
 
Upvote 0
i need to do advanced filter on columns A,B and C and paste them in another location in the same worksheet... maybe columns H,I and J... is this what you asked me? if so, how do i do tat? if not, can you phrase it a little clearly? Thanks
 
Upvote 0
The first option when you goto Advanced Filter is Copy to another location.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,039
Members
449,063
Latest member
ak94

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