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 Apr 9th, 2002, 12:00 PM   #1
guest
Board Regular
 
Join Date: Feb 2002
Posts: 91
Default

When i copy a formula in varying length of report it copies it till the end if i highlight a column and paste the formula in it. for eg i am concatenating column a & b and the i copy =CONCATENATE($A1,$B1) then i highlight column d and cut and paste it then it copies till the end ie 65000+ rows. problem is at the time of set print it thinks that there are so many rows now how to get rid of this problem and i am using macro
guest is offline   Reply With Quote
Old Apr 9th, 2002, 12:10 PM   #2
guest
Board Regular
 
Join Date: Feb 2002
Posts: 91
Default

The message might not be clear so posting again
1. I am trying to copy concatenate formula ie concatenation of col a and b
2. after i copied the formula i select the col so lets say i am trying to paste it in d
so i select d:d at the top and say paste
3. now it paste till the end of sheet ie 65000 rows + i want it to paste only till where there is data. i am doing d:d select because my report is going to be of varying length depending on the data sent into excel.

Any thoughts??
Thanks
guest is offline   Reply With Quote
Old Apr 9th, 2002, 12:20 PM   #3
guest
Board Regular
 
Join Date: Feb 2002
Posts: 91
Default

Please help me on this
Thanks
guest is offline   Reply With Quote
Old Apr 9th, 2002, 12:22 PM   #4
Von Pookie
MrExcel MVP, Administrator
 
Von Pookie's Avatar
 
Join Date: Feb 2002
Location: The act or process of locating.
Posts: 13,679
Default

Copy the formula you wish to paste.

Press control + G for the goto box.

Type in the range you want to paste to (for example, if your rows go to 500, type d1:d500) and it will select that range. Then paste your code.

Hope this helps,
Von Pookie is offline   Reply With Quote
Old Apr 9th, 2002, 12:24 PM   #5
guest
Board Regular
 
Join Date: Feb 2002
Posts: 91
Default

but the problem is i dont know the range it could be varying depending on the query results. i am directing the query results into excel and then formatting it using macro
guest is offline   Reply With Quote
Old Apr 9th, 2002, 12:25 PM   #6
Von Pookie
MrExcel MVP, Administrator
 
Von Pookie's Avatar
 
Join Date: Feb 2002
Location: The act or process of locating.
Posts: 13,679
Default

Ugh. I missed that part. I unfortunately can't do macros, sorry (wish I could, though).

I'm assuming you may have to add something to your existing macro to do that, though.
Von Pookie is offline   Reply With Quote
Old Apr 9th, 2002, 12:29 PM   #7
guest
Board Regular
 
Join Date: Feb 2002
Posts: 91
Default

Thanks
guest is offline   Reply With Quote
Old Apr 9th, 2002, 12:34 PM   #8
guest
Board Regular
 
Join Date: Feb 2002
Posts: 91
Default

Can anyone help me on this?
guest is offline   Reply With Quote
Old Apr 9th, 2002, 01:09 PM   #9
guest
Board Regular
 
Join Date: Feb 2002
Posts: 91
Default

any help will be apreciated
guest is offline   Reply With Quote
Old Apr 9th, 2002, 06:48 PM   #10
Derek
Board Regular
 
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
Default

Hi Guest

Try this code. It gives a hard value rather than a formula, but it can be changed to a formula if you wish.

For Each cell In [A:A]
If cell.Value <> "" Then
cell.Offset(0, 3).Value = cell.Value & cell.Offset(0, 1).Value
End If
Next
End Sub

If you want to use the concatenate formula use this code. The difference is that the above macro will make a number 1525 by joining 15 and 25 but the concatenate code below gives 1525 as text

For Each cell In [A:A]
If cell.Value <> "" Then
cell.Offset(0, 3).Formula = "=CONCATENATE(RC[-3],RC[-2])"
End If
Next
End Sub

Note that the 3 in the first offset statement refers to column D (3 columns to the right of A), change this number to the number of your destination column.


Hope this helps
regards
Derek


[ This Message was edited by: Derek on 2002-04-09 17:59 ]
Derek 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 03:14 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