View Single Post
  #9   Report Post  
qflyer
 
Posts: n/a
Default


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


Ron,

I created a simple workbook with just a few dates in A and a few
approaches in B, and this works perfectly.

However, being the novice that I am, I don't understand how to change it
from looking in column B for the approaches to looking at column F where
I enter my approaches.

Also, I don't know if this matters, but my individual logbook entries
start in row 50. The rows above 50 are used for a summary of flight
time, etc...

One final request...would you be able to post the code you use for your
logbook that uses the 6 calendar months rather than 180 days? That could
be useful to me in the future if I ever move to a different company
without a 180 day requirement.

Thanks so much,
Scott


--
qflyer
------------------------------------------------------------------------
qflyer's Profile: http://www.excelforum.com/member.php...o&userid=24448
View this thread: http://www.excelforum.com/showthread...hreadid=382548