Separate large data set onto multiple tabs

crimsonexcel

New Member
Joined
Feb 22, 2011
Messages
17
Hi,

I have a large data set (150,000 rows). Each row has 16 columns. I need to separate this data set onto separate tabs based on the text description in column E.

For example there may be 2,000 rows with a description like "Swedish actions in the second world war" I need for excel to recognize the country in the description "Swedish" and pull all rows like this to a new tab in the document called "Swedish". I actually already have the tabs created (about 50 countries) but realize it may be easier to start from scratch.

To further the example, the next 8,000 rows might have titles like "British icons in the 18th century" or "British revolutions and their outcomes". These 50,000 rows may have different descriptions but they are all common in that they start with "British" Again, would need to pull this data to a new tab called "British".

It looks like the first word of every description line is in fact the country if that is at all helpful.

To slightly complicate things, I have around 60 excel files that are all 500,000 rows and need to be sorted this way. Ideally I could drop a master data list (i.e. 1 file) into the first tab of a master document with all of these tabs and have it sort into each tab. I would then repeat this with the next file so that in the end, I have one master file that has everything sorted into tabs (with data collected from all 60 excel files)

Obviously realize I will probably need to do some manual labor to make this happen, just trying to cut my work time down from weeks to days or hours.

Any help would be much appreciated. I have not posted before, so please let me know if you need further information.

Thanks!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Welcome to the forums!

Are you able to provide a list for all of the "countries" that you want it to extract into separate tabs? Excel cannot inheriently know what word is a country, so we have to tell it what to pull out.
 
Upvote 0
Thanks so much for the quick response! Yeah, I know the 50 or so countries / nationalities that excel would be looking for, so could enter those into some sort of macro or function. Do you need to see that list?
 
Upvote 0
Yes, please.

Also, would you be able to provide a bit of sample data (20 or 30 rows) so I can test what I write?
 
Upvote 0
Absolutely. What is the best way for me to post excel data for you? I see the ability to post it as an image but am not seeing a way to insert a table or something that you could copy data from. Thanks again!
 
Upvote 0
If you don't have the HTML maker or Excel Jeanie, put borders (inside borders and outer borders) around the area you want to copy over. Then highlight those cells and copy/paste.
 
Upvote 0
Hmm..it does not look like the boarder are coming through...let me know if there is something else I should do or a better way to get you the sample data.

<table border="0" cellpadding="0" cellspacing="0" width="1681"><col style="width: 62pt;" width="82"> <col style="width: 53pt;" width="70"> <col style="width: 95pt;" width="126"> <col style="width: 227pt;" width="302"> <col style="width: 83pt;" width="110"> <col style="width: 78pt;" width="104"> <col style="width: 35pt;" width="47"> <col style="width: 56pt;" width="75"> <col style="width: 75pt;" width="100"> <col style="width: 70pt;" width="93" span="2"> <col style="width: 82pt;" width="109"> <col style="width: 99pt;" width="132"> <col style="width: 111pt;" width="148"> <col style="width: 32pt;" width="43"> <col style="width: 35pt;" width="47"> <tbody><tr style="height: 15pt;" height="20"> <td class="xl63" style="height: 15pt; width: 62pt;" width="82" height="20">SECTION_ID</td> <td class="xl63" style="border-left: medium none; width: 53pt;" width="70">EVENT_ID</td> <td class="xl63" style="border-left: medium none; width: 95pt;" width="126">ENTER_DATE</td> <td class="xl63" style="border-left: medium none; width: 227pt;" width="302">FULL_DESCRIPTION</td> <td class="xl63" style="border-left: medium none; width: 83pt;" width="110">EDIT_DATE</td> <td class="xl63" style="border-left: medium none; width: 78pt;" width="104">STATUS</td> <td class="xl63" style="border-left: medium none; width: 35pt;" width="47">VALUE</td> <td class="xl63" style="border-left: medium none; width: 56pt;" width="75">REGION_ID</td> <td class="xl63" style="border-left: medium none; width: 75pt;" width="100">CATEGORY</td> <td class="xl63" style="border-left: medium none; width: 70pt;" width="93">CATEGORY_ID</td> <td class="xl63" style="border-left: medium none; width: 70pt;" width="93">Sub_Category</td> <td class="xl63" style="border-left: medium none; width: 82pt;" width="109">Sub_Category ID</td> <td class="xl63" style="border-left: medium none; width: 99pt;" width="132">Additional Category</td> <td class="xl63" style="border-left: medium none; width: 111pt;" width="148">Additional Category ID</td> <td class="xl63" style="border-left: medium none; width: 32pt;" width="43">Save?</td> <td class="xl63" style="border-left: medium none; width: 35pt;" width="47">Filter?</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">2/6/2010 17:51</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian History/Norwegian Wars/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">2/6/2010 17:51</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">History</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Wars</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">52</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">2/6/2010 17:51</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian History/Norwegian Wars/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">2/6/2010 17:51</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">History</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Wars</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">52</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">2/6/2010 17:51</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian History/Norwegian Wars/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">2/6/2010 17:51</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">History</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Wars</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">52</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian Government/19th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">4</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">19h Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">17</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian Government/19th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">2</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">19h Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">17</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian Government/19th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">2</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">19h Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">17</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian Government/19th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">2</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">19h Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">17</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian Government/19th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">2</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">19h Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">17</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5225</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Norwegian Government/19th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">5/7/2010 18:22</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">19h Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">17</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Government/17th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">17th Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">15</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Government/17th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">17th Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">15</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Government/17th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">4</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">17th Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">15</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Government/17th Century/</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl66" style="border-top: medium none; border-left: medium none;">Government</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">14</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">17th Century</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">15</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">na</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">6</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">6</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">7998</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Finnish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">3/7/2010 16:46</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">3</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1235</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Swedish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">6</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1235</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Swedish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1235</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Swedish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">6</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1235</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Swedish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; border-top: medium none;" align="right" height="20">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1235</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Swedish Society/Customs and Traditions/Food</td> <td class="xl65" style="border-top: medium none; border-left: medium none;" align="right">4/7/2010 16:01</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">CORRECT</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">5</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">1</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Society</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">116</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">Customs</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">33</td> <td class="xl65" style="border-top: medium none; border-left: medium none;">Food</td> <td class="xl64" style="border-top: medium none; border-left: medium none;" align="right">8</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> <td class="xl64" style="border-top: medium none; border-left: medium none;">YES</td> </tr> </tbody></table>
List of Countries:

<table border="0" cellpadding="0" cellspacing="0" width="82"><col style="width: 62pt;" width="82"> <tbody><tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; width: 62pt;" width="82" height="20">Argentine</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Australian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Austrian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Belgian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Brazilian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Bulgarian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Croatian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Cypriot</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Czech</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Danish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Dutch</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">English</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Finnish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">French</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">German</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Greek</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Hungarian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Irish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Italian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Japanese</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Mexican</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Northern Ireland</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Norwegian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Polish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Portuguese</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Romanian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Russian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Scottish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Slovakian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Slovenian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Spanish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Swedish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Swiss</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Turkish</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Ukranian</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">UnitedStates</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none;" height="20">Welsh</td> </tr> </tbody></table>
 
Upvote 0
Let me see what I can throw together.

Also, will the country name always appear first, or could it appear somewhere in the middle of the text? This will largely dictate my approach.
 
Upvote 0
I had already started this so I'll post what I have. Mr Kowz is very good at this so I'm sure whatever he posts will be an improvement.

At the moment it only sorts out one country per macro run.
It assumes the data is all in sheet1

The macro code goes in a standalone file. Run the macro and you navigate to the file with all your source data.

New Sheets are created with the InputBox value, which is the country seach term, and this is also used as the sheet name if it doesn't already exist.

I would go further and add an array of countries so it sorts the lot in one go but I think if Mr kowz is on it I'll stop here.


Code:
Sub SplitCountry()
Dim Rng As Range
Dim Dn As Range
 
'Display Open Dialog
        CountryExtract = Application.GetOpenFilename("Excel Files (*.xls*)," & _
        "*.xls*", 1, "Select File", "Open", False)
 
'If the user Cancels file selection then exit
    If TypeName(CountryExtract) = "Boolean" Then
        Exit Sub
    End If
 
'Open Result File
        Workbooks.Open CountryExtract
 
'Separates the CountryExtract name from its full path
        SourceFile = Dir(CountryExtract)
 
 InputValue = InputBox("Input the country name")
 
'Activate the file
        Sheets("Sheet1").Activate
 
'Set the Range to end of filled column A
    Set Rng = Range(Range("E1"), Range("E" & Rows.Count).End(xlUp))
'Find Input
 
        firstRow = 1
    For Each Dn In Rng
'Finds last filled column
        lastCol = ActiveSheet.Range("A1").End(xlToRight).Column
 
'Returns > 0 if match found
    If InStr(Dn.Value, InputValue) > 0 Then
        CountryRow = Dn.Row
'Selects row to last column
        ActiveSheet.Range("A" & CountryRow, ActiveSheet.Cells(CountryRow, lastCol)).Select
 
 
'Copies and pastesd to new sheet in the Source file. renames sheet from Input Box value
 
        Selection.Copy
 
'Name sheet if not already existing
    If WorksheetExists(InputValue) Then
    Windows(SourceFile).Activate
 
        Worksheets(InputValue).Select
        Range("A1").Activate
    Do While Not IsEmpty(ActiveCell)
        ActiveCell.Offset(1, 0).Select
    Loop
    Selection.PasteSpecial
 Else
        Worksheets.Add
        ActiveSheet.Name = InputValue
   Range("A1").Activate
    Do While Not IsEmpty(ActiveCell)
        ActiveCell.Offset(1, 0).Select
    Loop
    Selection.PasteSpecial
 End If
        Sheets("Sheet1").Activate
 
End If
 
Next Dn
        MsgBox ("Macro Finished")
End Sub
'Does the worksheet exists
    Function WorksheetExists(WSName) As Boolean
        On Error Resume Next
        WorksheetExists = Worksheets(WSName).Name = WSName
    On Error GoTo 0
    End Function
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,532
Messages
6,179,388
Members
452,908
Latest member
MTDelphis

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