MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 19th, 2002, 02:23 PM   #1
akbob
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Newbie to the board, hope someone can help.

Here is what I want to do. I have a list of email addresses in column A. I want to update the list in column A with unique addresses from column B, and have the duplicates deleted from column B. I should end up with a complete uniques only list in column A, and a list of the uniques that were just added in Column B.

Anybody have a quick an easy solution for me?

Bob
akbob is offline   Reply With Quote
Old Mar 19th, 2002, 02:48 PM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-19 13:23, akbob wrote:
Newbie to the board, hope someone can help.

Here is what I want to do. I have a list of email addresses in column A. I want to update the list in column A with unique addresses from column B, and have the duplicates deleted from column B. I should end up with a complete uniques only list in column A, and a list of the uniques that were just added in Column B.

Anybody have a quick an easy solution for me?

Bob
Lets say that you have the email addresses in B from B2 on. If you have a label/column heading in B1, format it first as bold and italic. If you don't have one, enter e.g., Blist in B1 and format B1 as bold and italic.

Activate B2.
Activate Data|Filter|Advanced Filter.
Check 'Copy to another location'.
Enter as value of 'List range'.

$B$2:$B$8 [ adjust to suit ]

Enter as value of 'Copy to', e.g.,

$D$2

Check 'Unique records only'.

Click OK.

Copy everything from D2 on and paste it after your last email-address in A.

Delete column B.

Column D is now your second list of unique email adresses.

Aladin

Aladin Akyurek is offline   Reply With Quote
Old Mar 19th, 2002, 02:55 PM   #3
akbob
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Thanks for the quick reply Aladin! I'll give this a shot, it looks simple enough.

Bob
akbob is offline   Reply With Quote
Old Mar 19th, 2002, 03:34 PM   #4
Al Chara
MrExcel MVP
 
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
Default

If you want to use a macro (but the situation doesn't need one) try the code below (I borrowed some from Chip Pearson's page):

Dim r As Long
Dim V As Variant
Dim Rng As Range
Application.ScreenUpdating = False
Set Rng = Intersect(ActiveSheet.UsedRange.Rows, Columns("b"))

For r = Rng.Rows.Count To 1 Step -1
V = Rng.Cells(r, 1).Value
If Application.WorksheetFunction.CountIf(Rng.Columns(1), V) > 1 Then
Rng.Cells(r, 1).Delete
End If
Next r
Range(Range("B1"), Range("B1").End(xlDown)).Copy
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste
Set Rng = Intersect(ActiveSheet.UsedRange.Rows, Columns("a"))

For r = Rng.Rows.Count To 1 Step -1
V = Rng.Cells(r, 1).Value
If Application.WorksheetFunction.CountIf(Rng.Columns(1), V) > 1 Then
Rng.Cells(r, 1).Delete
End If
Next r
Application.ScreenUpdating = True

The code goes through column B and deletes duplicate entries then it appends the address at the bottom of column A and then deletes the duplicates of column A.
__________________
Kind regards,

Al Chara
Al Chara is offline   Reply With Quote
Old Mar 19th, 2002, 03:35 PM   #5
akbob
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Well, ok, not as simple as I thought Geeze, I feel like an idiot. I know this should be simple

I have two columns set up. Current (A) and New (B). I select B2, Advanced Filter. It defaults to the list range including both columns. I select C2 for the copy to range, and click unique only. When I click on OK, it just copies both columns as is in C and D, without filtering out duplicates. What am I doing wrong?

Thanks for helping this dummy out here.

Bob
akbob is offline   Reply With Quote
Old Mar 19th, 2002, 03:53 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-19 14:35, akbob wrote:
Well, ok, not as simple as I thought [img]/board/images/smiles/icon_frown.gif[/img] Geeze, I feel like an idiot. I know this should be simple

I have two columns set up. Current (A) and New (B). I select B2, Advanced Filter. It defaults to the list range including both columns. I select C2 for the copy to range, and click unique only. When I click on OK, it just copies both columns as is in C and D, without filtering out duplicates. What am I doing wrong?

Thanks for helping this dummy out here.

Bob
Just change manually the default range to the desired B-range:

if it says e.g.,

$A$1:$B$8

change A to B, you'll be OK.
Aladin Akyurek is offline   Reply With Quote
Old Mar 19th, 2002, 04:01 PM   #7
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-03-19 14:35, akbob wrote:
Well, ok, not as simple as I thought Geeze, I feel like an idiot. I know this should be simple

I have two columns set up. Current (A) and New (B). I select B2, Advanced Filter. It defaults to the list range including both columns. I select C2 for the copy to range, and click unique only. When I click on OK, it just copies both columns as is in C and D, without filtering out duplicates. What am I doing wrong?

Thanks for helping this dummy out here.

Bob
Hi akbob:
Here are the steps you need to take:
1. Copy data from column A to the end of the data in column B ... this will give you the entire data set from column A and B together -- duplicates and all
2. Now insert a blank column to the left of column B, so now your entire dataset is in column C
3. Click somewhere within the dataset in column C (make sure that your dataset is selected to be filtered) and click on Data|Filter|Advanced Filter ... and check Unique records only
4. Now you have your data filtered in place as you requested.
5. You may now want to copy the filtered data to another column, say column E
6. Now you have a hard copy of your filtered data ... unique records from originally column A and B combined.
now you may copy the data else where as you need
HTH

__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Mar 19th, 2002, 05:18 PM   #8
akbob
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Hi All,

Thanks for all your help.

I really appreciate the Macro Solution Al Chara posted, because this will be something that will need to be done frequently. It would also allow me to have the most current list, and the most curent additions to the list.

The problem I have with the Macro as is however, is that it's deleting the wrong records from column A. No deletions should be made from Column A. For each entry in column B, they should be added to column A if unique, or Deleted from Column B if already present in Column A.

I've tried messing with the macro code to see if I could fix it, but I'm operating in the dark here. Can anyone see/fix the problem with the Macro?

Thanks again everyone.

Bob
akbob is offline   Reply With Quote
Old Mar 19th, 2002, 05:21 PM   #9
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-19 16:18, akbob wrote:
Hi All,

Thanks for all your help.

I really appreciate the Macro Solution Al Chara posted, because this will be something that will need to be done frequently. It would also allow me to have the most current list, and the most curent additions to the list.

The problem I have with the Macro as is however, is that it's deleting the wrong records from column A. No deletions should be made from Column A. For each entry in column B, they should be added to column A if unique, or Deleted from Column B if already present in Column A.

I've tried messing with the macro code to see if I could fix it, but I'm operating in the dark here. Can anyone see/fix the problem with the Macro?

Thanks again everyone.

Bob
Did you try recording a macro, while applying the procedure I described?
Aladin Akyurek is offline   Reply With Quote
Old Mar 19th, 2002, 05:37 PM   #10
akbob
New Member
 
Join Date: Mar 2002
Posts: 7
Default

Quote:

Did you try recording a macro, while applying the procedure I described?
Hi Aladin -

I've haven't been able to get your solution to copy only the unique records from Column B. It just copies everything in column B, even if it is present in Column A. I was planning on recording it as a macro if I could make it work right though.

Bob
akbob is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On

Forum Jump


All times are GMT -4. The time now is 04:27 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes