Collecting Data from multiple worksheets

Mickdelo

New Member
Joined
Feb 27, 2009
Messages
13
Hi All,

I have a load of worksheets that i'd like to collect data from and would appreciate some help with a suitable formula - see following info.

Wsht A is one of over 500+ worksheets, each Wsht is a standalone sheet for a particular BOQ (WBS) item of work. The wksht is split into 2 sections, the MTO section and the ACTUALS section.

The MTO section contains the engineering takeoff for the particular BOQ item and each row relates to a unique TAG No. and details info such as descr., tag no, area & sub-area locations, qty and other info not shown in the sample here.

The ACTUALS section is used to collect data on the various stages of installation for the unique TAG No. - see columns H to O. As TAG's are installed at the various stages, the info is entered into the ACTUALS section.

Sometimes the engineering takeoff is incomplete and ACTUAL field installations result in additional TAG No.s being installed in the field, so additional rows have to be inserted in the spreadsheets - therefore it's not a fixed & static range.

Wsht B is a Summary Collection worksheet that collects data from all the BOQ(WBS) worksheets in a per AREA / SUB-AREA breakdown. That is, all BOQ items are listed down column A and data collected on the ACTUAL installation status per AREA/SUB-AREA in the succeeding columns.
At top of Wsht B is the Period section that is used to nominate the period in which data is sought for reporting purposes .eg. report out what quantity of BOQ(WBS) items were installed for week commencing 23-Feb-09 and ending 27-Feb-09. Other reports such as Daily, Monthly, Year to Date or Job to Date type collections could be obtained by changing the dates in the "FROM" and "TO" cells - see sample result manually inputed for period 23-Feb to 27-Feb.

What I'm looking for is the formula to do this. That is, formula in Wsht B cell I28 that looks at the Period (cells B20 to C20) and collects from the respective BOQ(WBS) worksheet (in this example Wsht A for BOQ item no. 16.8.5) the total quantity installed from column N per SUB-AREA (column E).
One of the challenges is, as stated above, the range my not be fixed (static) as additional rows may be inserted from time to time to cater for additional Tag No.s. Also, and similarly, each worksheet has differing number of rows .eg. some worksheets only have 20 - 30 rows, other worksheets may have 2000 rows - dependent on the number of TAG items for that particular BOQ worksheet.<SCRIPT language=JavaScript src="http://www.interq.or.jp/sun/puremis...IPT><CENTER><TABLE" target="_blank"></CENTER>
 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
All,

I'm having trouble getting the worksheets sample to appear in the post properly; will try to get it fixed to see if will display better.

Regards,
Mickdelo
 
Upvote 0
Hi Colin,

I didnt think you could attach spreadsheets, the alternative being the Colo HTML Maker, which is where i'm having the problem trying to get it to display the sample spreadsheets properly.

If there is another alternative i would be pleased to find out.

Best regards,
Mickdelo
 
Upvote 0
VoG,

Thanks for that; downloaded Jeanie and tested it and seems to work better; adding in the sample spreadsheets below here, hopefully comes out ok - thanks for your help.

Excel Workbook
ABCDEFGHIJKLMNO
2Wsht A
3MTO SectionACTUALS Section
4Calibrate15%Install70%Comms15%Total
5BOQDescriptionTag NoAreaSub-AreaMTO QtyQtyDateQtyDateQtyDateQtyDate
6
716.8.5Pressure TX124-30801-PTXFAFA021117-Oct-08112-Nov-0816-Jan-091.06-Jan-09
816.8.5Pressure TX124-30802-PTXFBFB101117-Oct-08118-Nov-0818-Jan-091.08-Jan-09
916.8.5Pressure TX124-30803-PTXFBFB391112-Dec-08116-Jan-09123-Feb-091.023-Feb-09
1016.8.5Pressure TX124-30804-PTXFDFD021112-Dec-08116-Jan-090.916-Jan-09
1116.8.5Pressure TX126-20006-DPTXFCFC391112-Jan-090.212-Jan-09
1216.8.5Pressure TX126-20007-DPTXFDFD021112-Jan-09125-Feb-090.925-Feb-09
13
14
15Totals6.04.925-Feb-09
Wsht A
Excel Workbook
ABCDEFGHIJKLMNO
17Wsht B
18Period:FROMTO
1923-Feb-0927-Feb-09AREA / SUB-AREA
20FAFBFCFD
21BOQDescriptionServiceFA02FA10FA39FB02FB10FB39FC02FC10FC39FD02FD10FD39
22
2316.8.1Temp TXGas
2416.8.2Temp HSGas
2516.8.3Temp INDGas
2616.8.4Flow INDGas
2716.8.5Pressure TXGas10.9
2816.8.6Pressure TXGas
29
Wsht B


Any help on workable formula is much appreciated.
Regards,
Mickdelo
 
Upvote 0
Hi Mickdelo,

I have put together a routine (code below) which should provide what you require.

In putting this together, I have made the following assumptions.

The Headers in your Sheet A & B are on rows 1 to 4.

Also, in your sheet B results, you have a header "Service", which has been populated, however, on your sheet A there is no "Service" Header.

In the code below, reference to Sheet "Summary" reprosents your sheet B.

In addition, there is a sheet named "BASE", where I store a copy of the Summary Headers, from which I restore the Summary Headers after clearing the sheet prior to a new search.

You can have as many sheet A's as you require.

I'm using a Command Button to start a new search, which also validates the dates before running the main routine SummaryUD:

Code:

Private Sub CommandButton1_Click()
SD = Cells(2, 2)
ED = Cells(2, 3)
'If SD Or ED = "" Then GoTo endd
If IsDate(SD) = False Then GoTo endd
If IsDate(ED) = False Then GoTo endd
If (SD <> ED And SD > ED) Then GoTo endd
SummaryUD
endd:
End Sub

Sub SummaryUD()
Sheets("Summary").Activate
SD = Sheets("Summary").Cells(2, 2)
ED = Sheets("Summary").Cells(2, 3)
Columns("A:O").Select
Selection.ClearContents
Sheets("BASE").Activate
Range("A1:O4").Select
Selection.Copy
Sheets("Summary").Activate
Cells(1, 1).Select
ActiveSheet.Paste
Cells(1, 1).Select
Cells(2, 2) = SD
Cells(2, 3) = ED
SR = 4
For a = 1 To ThisWorkbook.Sheets.Count
If Sheets(a).Name = "Summary" Then GoTo nexta
If Sheets(a).Name = "BASE" Then GoTo nexta
r = Sheets(a).Range("O65536").End(xlUp).Row - 3
For b = 4 To r
If Sheets(a).Cells(b, 15) >= SD And Sheets(a).Cells(b, 15) <= ED Then
SR = SR + 1
Cells(SR, 1) = Sheets(a).Cells(b, 1).Value
Cells(SR, 2) = Sheets(a).Cells(b, 2).Value
SAR = Sheets(a).Cells(b, 5)
x = 4
st:
If Cells(4, x) <> SAR Then x = x + 1: GoTo st
Cells(SR, x) = Sheets(a).Cells(b, 14).Value
End If
Next b
nexta:
Next a
End Sub

If you have any difficulty applying this code, send me a private message with your email address, and I'll send you a copy of my working model.

Regards

ColinKJ
 
Upvote 0
Colin,

Thanks very much, your solution in its final revision has worked perfectly.

Really appreciate the help.

Best regards,

Mickdelo
 
Upvote 0

Forum statistics

Threads
1,215,819
Messages
6,127,045
Members
449,356
Latest member
tstapleton67

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top