My apologies, allow me to provide you with a more specific example:
Place these date_time in a worksheet named: Phase
12/31/00 18:081/1/01 6:501/1/01 18:381/2/01 6:441/2/01 19:081/3/01 7:56
Place these dates in Sheet2
1/1/01 0:151/1/01 0:301/1/01 0:451/1/01 1:151/1/01 1:301/1/01 1:451/1/01 2:151/1/01 2:301/1/01 2:451/1/01 3:151/1/01 3:301/1/01 3:451/1/01 4:151/1/01 4:301/1/01 4:451/1/01 5:151/1/01 5:301/1/01 5:451/1/01 6:151/1/01 6:301/1/01 6:451/1/01 7:151/1/01 7:301/1/01 7:451/1/01 8:151/1/01 8:301/1/01 8:451/1/01 9:151/1/01 9:301/1/01 9:451/1/01 10:151/1/01 10:301/1/01 10:451/1/01 11:151/1/01 11:301/1/01 11:451/1/01 12:151/1/01 12:301/1/01 12:451/1/01 13:151/1/01 13:301/1/01 13:451/1/01 14:151/1/01 14:301/1/01 14:451/1/01 15:151/1/01 15:301/1/01 15:451/1/01 16:151/1/01 16:301/1/01 16:451/1/01 17:151/1/01 17:301/1/01 17:451/1/01 18:151/1/01 18:301/1/01 18:451/1/01 19:151/1/01 19:301/1/01 19:451/1/01 20:151/1/01 20:301/1/01 20:451/1/01 21:151/1/01 21:301/1/01 21:451/1/01 22:151/1/01 22:301/1/01 22:451/1/01 23:151/1/01 23:301/1/01 23:451/2/01 0:151/2/01 0:301/2/01 0:451/2/01 1:151/2/01 1:301/2/01 1:451/2/01 2:151/2/01 2:301/2/01 2:451/2/01 3:151/2/01 3:301/2/01 3:451/2/01 4:151/2/01 4:301/2/01 4:451/2/01 5:151/2/01 5:301/2/01 5:451/2/01 6:151/2/01 6:301/2/01 6:45
Activate R1C2 in Sheet2
Run the following, which calculates the phase for three sets of dates from the Phase worksheet, but there must be a much more efficient method, as I have years of this information...? (i.e. could you assist me with converting this to more efficient loop?:
Sub Phaser()
Do While Not ActiveCell.Offset(-1, 0) = 0
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]>Phase!R2C[-1],0,(RC[-1]-Phase!R1C[-1])/(Phase!R2C[-1]-Phase!R1C[-1])*360)"
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(-1, 0).FormulaR1C1 = _
"=IF(RC[-1]>Phase!R3C[-1],0,(RC[-1]-Phase!R2C[-1])/(Phase!R3C[-1]-Phase!R2C[-1])*360)"
Do While Not ActiveCell.Offset(-1, 0) = 0
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]>Phase!R3C[-1],0,(RC[-1]-Phase!R2C[-1])/(Phase!R3C[-1]-Phase!R2C[-1])*360)"
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(-1, 0).FormulaR1C1 = _
"=IF(RC[-1]>Phase!R4C[-1],0,(RC[-1]-Phase!R3C[-1])/(Phase!R4C[-1]-Phase!R3C[-1])*360)"
Do While Not ActiveCell.Offset(-1, 0) = 0
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]>Phase!R4C[-1],0,(RC[-1]-Phase!R3C[-1])/(Phase!R4C[-1]-Phase!R3C[-1])*360)"
ActiveCell.Offset(1, 0).Select
Loop
End Sub