Hey guys,
I wrote this code that works to calculate the average total hours using the dates which obviously works however, I just wanted to be able to change the range "E3" and E34" so that if I apply to another file WITHOUT knowing the range I could still get the answer and the code will work, without changing the range in the module. Could anybody help me with that. I want the answer to go in the cell "B15"
Sub CalculateHours2()
Range("B15").Value = DateDiff("h", Range("E3").Value, Range("E34").Value)
End Sub
Thanks!
I wrote this code that works to calculate the average total hours using the dates which obviously works however, I just wanted to be able to change the range "E3" and E34" so that if I apply to another file WITHOUT knowing the range I could still get the answer and the code will work, without changing the range in the module. Could anybody help me with that. I want the answer to go in the cell "B15"
Sub CalculateHours2()
Range("B15").Value = DateDiff("h", Range("E3").Value, Range("E34").Value)
End Sub
Thanks!