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 20th, 2002, 09:07 PM   #1
corona
New Member
 
Join Date: May 2002
Posts: 10
Default

Hi.!

I got an excel file ( excel 97) which contains many worksheets.
All worksheets have same format.
I want to create new worksheet and combine data from every
worksheets into this new worksheet.
Could you please help me how to do this.?
Thank

Corona
corona is offline   Reply With Quote
Old May 20th, 2002, 09:46 PM   #2
PaddyD
MrExcel MVP
 
Join Date: May 2002
Posts: 13,278
Default

Corona,

welcome to the board!

I think we'll need a bit more info before anyone can try & help out. What do you mean by 'combine' - sum, count, something else? What sort of data have you got - text, numbers, formulas.

The more data you give, the more people get a view on exactly what you're trying to do.

Paddy
PaddyD is offline   Reply With Quote
Old May 20th, 2002, 10:18 PM   #3
corona
New Member
 
Join Date: May 2002
Posts: 10
Default

Hi!

Thanks.

"Combine"
I meant copy all data from every worksheet and put them together
in one worksheet.
( no sorting)
== example===
< Data from worksheet1>
< Data from worksheet2>
.
.
.
< Data from worksheet n>


K.Corona
corona is offline   Reply With Quote
Old May 20th, 2002, 10:23 PM   #4
PaddyD
MrExcel MVP
 
Join Date: May 2002
Posts: 13,278
Default

Corona,

You can't copy excel files to the board - can you give us a representative example?

Paddy
PaddyD is offline   Reply With Quote
Old May 20th, 2002, 10:36 PM   #5
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Hi Corna & Paddy : This is a reprint of a solution I did for someone the othr day ..... IS this What your looking for ?

This Macro should do the trick for you . It will go through all sheets of your workbook and copy information to summary sheet.

In this example the summary sheet is called "MailList"..though you can see that at top of macro you can change that.

To add more lines to macro just copy the line Sheets(ML).Cells(TargRow, 1) = SrcWs.Range("A1") and modify the number "1" and the "A1"

The "A1" should be changed to indicate which cell the information is coming from .
The Number "1" indicates which column you want it to be placed in the "Mailing List" sheet.

For example Let's say that the PO's has the person's name in Cell "C12" and you want these names placed in column 3 of the Mailing list then:
-- "A1" needs to be changed to "C12"
-- 1 needs to be changed to 3

If you have 10 pieces of information from each PO collected, just copy the line 10 times and make the appropriate "A1" and (1) changes.

HERE'S THE MACRO

Code:
Public Sub MakeMailingList()
ML = "MailList" ' This MUST match the SheetName of your Target MailList
TargRow = 0 ' Change Start Value to change Starting TargetRow, 0=row1
    For Each SrcWs In Worksheets
        If Not (SrcWs.Name = ML) Then
        TargRow = TargRow + 1
            
            '  Target columns here          SourceCells Here
            Sheets(ML).Cells(TargRow, 1) = SrcWs.Range("A1")
            Sheets(ML).Cells(TargRow, 2) = SrcWs.Range("C5")
        
        End If
    Next SrcWs
End Sub
This macro does not require any knowledge of sheet names other then the Target Mailing List sheet.
Don't have any other workbooks open when running macro.

PS Please let me know if this Macro met your needs.





[ This Message was edited by: Nimrod on 2002-05-18 04

[ This Message was edited by: Nimrod on 2002-05-20 21:39 ]
Nimrod is offline   Reply With Quote
Old May 20th, 2002, 10:45 PM   #6
corona
New Member
 
Join Date: May 2002
Posts: 10
Default

Hi.

Here is example.

I have an excel file ( corona.xls).
It has 15 worksheet with same format. Worksheet name are
Worksheet1, worksheet2, ... ,worksheet15.
I want to create new worksheet16
in corona.xls. I copy all data from
Worksheet1 to worksheet16 then
copy all data from worksheet2 to
worksheet16 (append) and do this job until all data from 15 worksheets are in worksheet16.
But it spend too much time to do
this copy & paste if I have many file to process.
Any other method for reduce copy & paste time?
I hope you can understand my situation.

K.Corona



corona is offline   Reply With Quote
Old May 20th, 2002, 10:50 PM   #7
PaddyD
MrExcel MVP
 
Join Date: May 2002
Posts: 13,278
Default

In which case ,Nimrod's code looks like just the thing!!

Post back if it works once you've made the appropriate modifications.


Paddy
PaddyD is offline   Reply With Quote
Old May 20th, 2002, 10:53 PM   #8
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Hmmm entire sheets heh ?
I'm going to spend a little time and see if I can give you something a little on point ...
Nimrod is offline   Reply With Quote
Old May 20th, 2002, 11:23 PM   #9
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Maybe this one is a little more "on point" . This macro will look for all worksheets in a workbook and copy all data to "sheet16" within the same workbook. Is this what you need ?

Code:
Sub CopyRanges()
TargSheet = "Sheet16"
For Each SrcWs In Worksheets
    With SrcWs
    If Not (.Name = TargSheet) Then
        SrcTopRow = .Range("A:A").End(xlUp).Row
        SrcBotRow = .Cells(65536, 1).End(xlUp).Row
        TargBotRow = Sheets(TargSheet).Cells(65536, 1).End(xlUp).Row + 1
        TargNewBot = TargBotRow + SrcBotRow - SrcTopRow
        .Rows(SrcTopRow & ":" & SrcBotRow).Copy
        ActiveSheet.Paste Destination:=Worksheets(TargSheet).Range(TargBotRow & ":" & TargNewBot)
    End If
    End With
Next SrcWs
End Sub
Nimrod is offline   Reply With Quote
Old May 20th, 2002, 11:30 PM   #10
corona
New Member
 
Join Date: May 2002
Posts: 10
Default

Hi NimRod

Thanks.
I will wait....

Thanks.
K.Corona
corona 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:45 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