I'm new-ish to VBA and have been able to do some simple coding but I've been having a hard time with my new, more complex task. My overall goal is to identify the number/percentage of samples that are collected within 12 hours and 24 hours of the first sample collected for each unique manufacturing code. I have been able to identify and pull each unique manufacturing code (B-Code) to column L and I'm hoping to be able to loop the code so that it determines the percentage of samples collected within 12 and 24 hours for each unique manufacturing code. I'm imagining this being done in steps-
Attached is a picture of the code I have so far for counting. My image of the file I have is too large to attach, but column 1 has every time that the unique value in column 12 appears. I'm trying to count the number of times that the value in column 12 appears in column 1. Then establish the earliest time it appears, excluding blanks, in column 5. Then count the number of time of samples from that unique manufacturing code occur within 12 and 24 hours of the first time. Thank you!!
- Count and hold the number of samples for each manufacturing code (B-Code).
- Determine the first sample of each B-Code and hold the time.
- Count the number of samples that are collected 12 hours after the first sample identified in #2 for each B-Code and get the percentage.
- Count the number of samples that are collected 24 hours after the first sample identified in #2 for each B-Code and get the percentage.
- Loop
Attached is a picture of the code I have so far for counting. My image of the file I have is too large to attach, but column 1 has every time that the unique value in column 12 appears. I'm trying to count the number of times that the value in column 12 appears in column 1. Then establish the earliest time it appears, excluding blanks, in column 5. Then count the number of time of samples from that unique manufacturing code occur within 12 and 24 hours of the first time. Thank you!!