Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default compiling multple worksheets

Are the sheets in different workbooks or all 15 sheets in the same workbook.

Assume in different workbooks, on the first sheet in the tab order, data
starts in cell A1 with column headers (so first requirement is on row 2).

Sub GrabSheets()

Dim varr As Variant
Dim rng As Range
Dim i As Long
'expand to include your workbooks.
varr = Array("Dept3.xls", "Dept42.xls", "Dept33.xls", _
"Dept36.xls", "Dept99.xls")

For i = LBound(varr) To UBound(varr)
Set rng = Workbooks(varr(i)).Worksheets(1). _
Range("A1").CurrentRegion
Set rng = rng.Offset(rng.Rows.Count, 0). _
Resize(rng.Rows.Count - 1)
rng.Copy ThisWorkbook.Worksheets(1). _
Cells(Rows.Count, 1).End(xlUp)(2)
Next
End Sub

You can then sort the data on product code and then do data=Subtotal on
product code with sum for quantity to get product sums. Click on the second
button in the outline section that will appear in the left side of the sheet
and it will collapse to show only the sums by product code.

If you want to automate that part, you can turn on the macro recorder while
you do it manually.
Put the code in a general module in the workbook where the master list will
be consolidated on the first sheet.

Regards,
Tom Ogilvy



Ian Truslove wrote in message
...
Hi
I'm a Supplies Manager in a Hospital. Each day the clinical departments
supply me with a excel spreadsheet detailing their requirments for
consumables for the next day. I've created these spreadsheets using a
"lookup" table which fills in description,specification number and loction
within the stores if they type the code number of the product required.

I've
never used "lookup" before and have been feeling really smug as to my
cleverness !!!!!
BUT I NOW NEED SOME HELP FOR THE NEXT STAGE.

Problem
Each of the sheets ( approximately 15 ) may contain the same products,

this
means I might potentially go to the same location point within the stores
multiply times to collect the same product.
Question
Is it possible to load multiple worksheets ( all in exactly the same
format ) into a single worksheet to enable me to sort into stores location
and total required for each product?

With my limited knowledge I would cut and paste each of the sheets into

one
master sheet and then sort by location code, I would then total each of

the
quantitys required by product code. Unfortunately I suspect my super time
saving idea would take longer than the old way.

I would appreciate any thoughts or suggestions

Thanks
Ian Truslove




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
extract data from multple worksheets to a summary worksheet TFA Excel Discussion (Misc queries) 1 May 28th 09 01:09 PM
Compiling data from several worksheets m Excel Discussion (Misc queries) 3 April 8th 09 03:00 AM
Lookup in multple worksheets Mike B Excel Worksheet Functions 5 March 4th 09 08:57 AM
Compiling data from multiple worksheets into one worksheet thelonious419 Excel Discussion (Misc queries) 1 April 24th 06 06:16 PM
Sorting data in a workbook across multple worksheets Phil Excel Worksheet Functions 7 June 22nd 05 08:49 PM


All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"