i have a macro that currently caluclates the start time and end time that a piece of equipment has been run on a specific day, which tells me the total machine run time for that day. Here's what i am attempting to do, is to have the same macro caluclate the start time and end time for a piece of equipement that has been ran on multiple days. So i need it to compare the dates find the min date and max date, take the times between those set of date and give me a total run time. Below is what i have so far can anyone give me advise as to what i need to add to my code in order to do this.....
'Find Run Start Date
Range("BB1").Formula = "=Min(C:C)"
'Find Run End Date
Range("BC1").Formula = "=Max(C:C)"
' Find Start Time and End Time for Each Date
If Range("BB1").Value = Range("BC1").Value Then
Range("BF1").Formula = "=min(B:B)"
Range("BG1").Formula = "=max(B:B)"
ElseIf Range("BB1").Value < Range("BC1").Value Then
Range("BF1").Formula = "=min(B:B)"
Range("BG1").Formula = "=max(B:B)"
Else
MsgBox ("Macro can't handle multiple days yet")
End If
Thank you for you help![]()
Bookmarks