Copying a Row Based on Coloumn Contents

Tizek

New Member
Joined
Aug 13, 2014
Messages
7
Hi All,

Firstly im sorry if this has been asnwered elsewhere. i have very limited experiance with excel and macros.
I can do lookups with sharepoint and infopath, but havent got a clue about excel.

Basicaly we have 1 database (so to speak) worksheet.
What im looking for is a macro that searches this sheet, depending on a cell value and then copys the entire row to another worksheet.

What i dont want it to do however is produce duplicates on the seperate tab if this makes sense.

The below link, is the spreadsheet,
https://dl.dropboxusercontent.com/u/65121181/Membership.xls

The Main Database tab would be TKDEL_Membership,
So we would fill in what we need to, what we would then like is If Group - Contains Future TKD as an example
It would then copy that row of data to the Future TKD tab.

All in all, off top of my head there is about 26 groups, so this would 26 tabs so the macro would need obviously search these, and do as described.


If someone could help me that would be super dooper.
 
……. Wow, Super!. –Your Code does the extra bits I wanted to but did not know how. I worked through your code and learnt a lot. Thanks. (I had no idea, for example, .about the Copy with Filter stuff and so that is……..


………….That's the first time I'd seen the copy with advanced filter as well, I did a google search for "Excel VBA extract unique values from a column" and it was in the first thread I clicked on, Lucky! When I looked it ………………………….
Hi Alan_P
. I guess maybe You already Know / knew this: In this his code line

Code:
Sheets("TKDEL_Membership").Range("G1:G1310").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheets("Unique1").Range("A1"), Unique:=True

The first Row is being copied directly as a header and not as a unique value?. ( http://www.mrexcel.com/forum/excel-...using-advanced-filter-unique-values-only.html ). - That caught me out yesterday when I stole this line from you to put in a code I wrote for an OP where his data did not have a heading – the first piece of data was therefore copied by that code line directly to the first piece of data in the filtered data , thereby giving a duplicate value in the first piece of data!.

. I find it a strange default option for the Advanced Filter (Unique) method. And strange that (as far as I know) there is no optional argument to just filter the data, without copying the first piece of data directly as a heading!?!
 
Last edited:
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,847
Messages
6,181,318
Members
453,032
Latest member
Pauh

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