Macro to extract data from multiple worksheets

egulphy

New Member
Joined
Mar 15, 2003
Messages
9
I'm in over my head here!

I have a spreadsheet containing a factory's operational data, with each machine in the factory being represented by its own worksheet.
The sheets all have the same structure, with each line of data representing a shift (we have 12-hour continental shifts, so column A of all the pages has the date in an standard format, and column B has either "d" or "n", representing the shift). Various datat is documented on each machine on a shift-per-shift basis.

What I need to do is figure out how to do a macro that extracts all of the lines on all of the machines' worksheets that pertain to a particular shift (for instance, all of the lines where column A read "14-Mar" and column B read "d"), and export the values of the entire row to another worksheet, creating a shift summary on one page.

To do this, I would like to make the date and shift user-definable variables that appear at the top of what would become the summary sheet, and have a button that activated such a macro at the top of the page as well.
 
Hi,

I would like to have a question about your post. What happen to the IF statement if the dates in cell B1 and F1 of Sheet DAILY in a diffent workbook( ex. BOOK1) How can we call the two dates?

I mean how can you change the two line of code: (b/c the sheet is in another workbook: BOOK2)
----
IF Wksht.Range("B"&r) = Sheets("DAILY").Range("B1").Value _
And Wksht.Range("B &r) = Sheets("DAILY").Range("F1").Value Then
----

Thank you very much
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi

I have a workbook with many worksheets. The individual worksheets are time sheets. When needed a macro executes a blank sheet, the user fills it in, and so on. These worksheet tabs are TS1, TS2, TS3, etc. There is another sheet that the user needs to fill-in on occasion. When needed a macro executes a blank sheet, the user fills it in, and so on. These worksheet tabs are CTS1, CTS2, etc. I need a summary sheet bringing in all the worksheet tabs named TS1, etc. and CTS1, etc. I have looked at a lot of code but can’t find anything that quite matches my request. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
On the TS1 worksheet’s the following cells are needed:<o:p></o:p>
C6=Name/Location
C7=Date<o:p></o:p>
C11=Hourly Rate<o:p></o:p>
E11=Hours Worked<o:p></o:p>
G11=Shift Total<o:p></o:p>
On the CTS worksheets the following cells are needed:<o:p></o:p>
C2=Date<o:p></o:p>
D4=Name/Location<o:p></o:p>
F33=Hours Worked<o:p></o:p>
G33=Hourly Rate<o:p></o:p>
H33=Shift Total<o:p></o:p>
On the summary sheet I would need these column headings.
<o:p>Very much a newbie. </o:p>
<o:p>Jam</o:p>
 
Upvote 0
Hi,

I am a newbie with VBA.

I am trying to use a macro to do something similar to the code phantom1975 posted, however I would like to modify it to look for the absolute value in each tab of a workbook that exceeds 5%. Similar to the original code, I would like for the macro to list out all instances in the 'List' tab.

The purpose of the macro is to aid in identifying instances that exceed 5% for financial analysis. Would you know how to modify the syntax to accomplish this?

Thank You!
 
Upvote 0

Forum statistics

Threads
1,215,879
Messages
6,127,515
Members
449,385
Latest member
KMGLarson

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