finding a date in multiple sheets

VbaRookie_MyStation

New Member
Joined
Mar 28, 2022
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
So it's a little complicated what I need. Therefore bare with me :).


I need to find a date which will be taken from a sheet called Raport. Cell where data validation of the date is "D4".
I need that date to be searched in multiple sheets. Each sheet is showing like this:

Raport_CHO.xlsm
CDEFGHIJ
1204014TargetActualC/O PerformanceP2PS2P
23/24/2022 9:133/24/2022 9:133/25/2022 9:131:14:000:00:020.05%
33/25/2022 9:133/25/2022 9:130:20:000:00:000.00%3/25/2022 9:13
40:34:000:00:010.05%3/25/2022 9:13
51:14:000:00:020.05%3/25/2022 9:13
6 
7 
8 
9 
10 
L1_4701A 25_03
Cell Formulas
RangeFormula
H2:H10H2=IFERROR(G2/F2,"")



The problem is that based on selected date, on P2P or S2S, based on sheet name and based on shift pattern, I need to return the value of Target and Value of actual (which is in hh:mm:ss).

Conditions:

P2P and S2S are the columns where the dates are entered. If P2P is Empty it means it was used S2S and viceversa. (FYI.. This happens when its pressed a button, which means the time stamp is placed automatically)
P2P time could be 00:40:00 or 00:20:00, while S2S is always 00:14:00.

Sheet name si a fixed name L1_4701A, L2_4701B, L3_4701C, L4_4701D, L5_4701E, L6_4701F, L7_4701G, L8_4701H.
Each sheet in addition to its name has a date of the file when it was extracted e.g.: "L1_4701A 25_03"

Shift Patterns is
' Shift 3 - 22:00:01 - 00:00:00
' 00:00:01 - 06:00:00 (This is on the next day)
'Shift 1 06:00:01 - 14:00:00
'Shift 2 14:00:01 - 22:00:00

After selecting the date, I need to place the data according to which sheet name is (without date) L1_4701A, L2_4701B, L3_4701C, L4_4701D, L5_4701E, L6_4701F, L7_4701G, L8_4701H into another sheet, which is dedicated for collecting all data.

Raport_CHO.xlsm
STUVWXYZAAABACADAEAF
2L1_4701ADataShift1Shift2Shift3
3TargetActualP2PS2PTargetActualP2PS2PTargetActualP2PS2P
43/25/2022
53/26/2022
63/27/2022
73/28/2022
83/29/2022
93/30/2022
103/31/2022
114/1/2022
InformatiiColectate


In Coloumn Target and Actual I need to sum of all items from Target and Actual based on shift patterns.

If it's not the right thread, I'll kindly ask you to tell me as this is my firs post.

Thank you !
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,223,956
Messages
6,175,613
Members
452,661
Latest member
Nonhle

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