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 May 16th, 2002, 03:03 AM   #1
geforce
New Member
 
Join Date: May 2002
Posts: 2
Default

I need the answer to a simple problem but cant find it anywhere.
I have 2 work books (wb1 and wb2)
I have a column with 20 names in wb1 and I would like a formula that will put every odd name (eg name 1,name 3,name 5, etc) into a column in wb2(work book 2).
In short I need a formula to copy every alternative cell in a column into another column.
geforce is offline   Reply With Quote
Old May 16th, 2002, 03:13 AM   #2
crimlet
Board Regular
 
Join Date: May 2002
Location: Ipswich, Suffolk, England
Posts: 135
Default

Is the task only to copy every alternate cell, or one to copy a single name when duplicated ?
crimlet is offline   Reply With Quote
Old May 16th, 2002, 03:19 AM   #3
geforce
New Member
 
Join Date: May 2002
Posts: 2
Default

just to make a copy of every alternate name no other conditions, a straight copy and paste of name 1 name 3 name 5 name 7 etc

eg if I have a colum in wb1 that looks like this:
cathy
ben
bob
fred
mary

Then wb2 colum should look like this:
cathy
bob
mary
geforce is offline   Reply With Quote
Old May 16th, 2002, 03:44 AM   #4
paelinck
Board Regular
 
Join Date: Mar 2002
Location: Leiden, The Netherlands
Posts: 68
Default

Quote:
eg if I have a colum in wb1 that looks like this:
cathy
ben
bob
fred
mary

Then wb2 colum should look like this:
cathy
bob
mary
You might try this.

1. copy all the names from WB1 to WB2. Put a column title in the topmost cell (e.g. "Name")
2. in the next column (let's say column B), put TRUE next to the first name or FALSE if you don't want to keep it (let's suppose this is cell B2). You can add a title "Keep" in cell B1.
3. In B3 put the formula =NOT(B2) and copy it down as far as the name list goes.
4. Use the Autofilter to show only the names that have FALSE beside them. Select these rows and delete them (Edit - Delete).

Marc
paelinck is offline   Reply With Quote
Old May 16th, 2002, 03:48 AM   #5
Colo
MrExcel MVP
 
Colo's Avatar
 
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
Default

Microsoft Excel - Book1_______________Running: xl97 : OS = Windows (32-bit) 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
D17=
*ABCD
1cathy:alert("=MOD(ROW(),2)")>1**
2ben :alert("=MOD(ROW(),2)")>0**
3bob :alert("=MOD(ROW(),2)")>1**
4fred :alert("=MOD(ROW(),2)")>0**
5mary :alert("=MOD(ROW(),2)")>1**
Sheet1

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.23]
If you want this code, click here and Colo will email the file to you.
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo


Hi geforce,

You could use a autofilter and mod and row formula.
Input formulas into column B, and using autofilter, and select 1 or 0 on autofilter.

After this, copy the filter range and paste it into another sheet.
__________________
Regards,

Masaru Kaji aka Colo - Ex Microsoft MVP Since 2004 -2009
Colo is offline   Reply With Quote
Old May 16th, 2002, 01:19 PM   #6
DZarlengo
Board Regular
 
Join Date: May 2002
Posts: 63
Default

This is a simple matter for a loop. Remember that you can use "Step" in loops. For example, to copy every other cell:

For X = 1 to 100 Step 2
Cells (X,1).Copy
Next X

You could insert a line to load them into an array and then later paste them all at once. That would be fastest. You could also paste each one as soon as you copy it, but it would take a nested loop (not too hard), and run slower.
DZarlengo is offline   Reply With Quote
Old May 16th, 2002, 01:23 PM   #7
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Or, you could follow my bestest good mate Chris D's advice on this similar thread:

http://www.mrexcel.com/board/viewtop...c=5620&forum=2

(or you could follow mine, but Chris says his is more generic and I believe him)
__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien is offline   Reply With Quote
Old May 16th, 2002, 02:45 PM   #8
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

one day CHris assure me you tell him Celtic will win the cup!


__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old May 16th, 2002, 07:33 PM   #9
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Thought you'd like that one Jack.
__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien is offline   Reply With Quote
Old May 17th, 2002, 12:55 AM   #10
asramasarma
New Member
 
Join Date: May 2002
Location: India
Posts: 10
Default

Hai i think this will workout for you

For i = 1 To 21 Step 2
Cells(i, 1).Select
Selection.Copy
Windows("dest.xls").Activate
Cells(i, 1).Select
ActiveSheet.Paste
Windows("sourse.xls").Activate
Next

[ This Message was edited by: asramasarma on 2002-05-16 23:58 ]
asramasarma 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 08:09 AM.


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