View Single Post
  #7   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Mon, 27 Jun 2005 22:55:16 -0500, qflyer
wrote:


Ron,

You're right about the regs. The 180 days is a company policy in place
from the company I fly for. We have requirements for 30, 90, and 180
days flight experience. Thanks for any assistance you can provide.

Scott


Well, here is a very simple UDF written in VBA that should get you started.

It assumes your Dates are in Column A and your approaches are in Column B.

It will display your current currency date, regardless of whether it is before
or after TODAY. It can be extensively modified depending on your requirements
and needs.

To use it, enter
=instcur()
in any cell.

To enter it, <alt-F11 opens the VB Editor. Ensure your project is highlighted
in the project explorer window, then Insert/Module and paste the code below
into the window that opens:

==================
Option Explicit

Function InstCur() As Date
Application.Volatile
Dim i As Long
Dim LastRow As Long
Dim AppCount As Long
Const ReqAppCount As Long = 6

LastRow = Range("A65535").End(xlUp).Row

For i = LastRow To 1 Step -1
AppCount = AppCount + Cells(i, 2).Value
If AppCount = ReqAppCount Then Exit For
Next i

InstCur = Cells(i, 1) + 180

End Function
==================


--ron