Other - Example 3
Other - Example 3 Benford's Law Fraud detectionDownloads First digits lawSite Map
Home Page | Population | Sampling | Fraud | Other | Tutorial | Macros
Other - Example 3
Sub Example3()
'
' obtain totals
' for the column "paidamt" for claims for service within the
' period October 4, 2004 - October 20, 2004
' file is read and then
' the file totals are shown on the Excel status bar
'
Dim ofile As New cNFile
'Dim sbuffer As String
'Dim i As Integer
Dim sMsg As String
Dim sText As String
Dim dTotals As Double
Dim icol As Integer
Dim sTextName As String
Dim iPaidAmountColumn As Integer
Dim iProviderNumberColumn As Integer
Dim iFromDateOfService As Integer
Dim sFormattedNumber As String
Dim dDate As Date

Application.Cursor = xlWait
ofile.Filename = BASEDIR & "clmdenbp.txt"
sTextName = "paidamt"
Call ofile.OpenFile
iPaidAmountColumn = ofile.getcolno("paidamt")
iFromDateOfService = ofile.getcolno("fdos")
'
' total paid amounts for provider numbers beginning with 80
'
Do While ofile.EOF = False
Call ofile.GetRow
sText = ofile.getcol(iFromDateOfService)
If IsDate(sText) Then
dDate = CDate(sText)
If dDate >= CDate("10/4/2004") And dDate <= CDate("10/20/2004") Then
sText = ofile.getcol(iPaidAmountColumn)
If IsNumeric(sText) Then
dTotals = dTotals + CDbl(sText)
End If
End If
End If
Loop
Set ofile = Nothing
sFormattedNumber = Format(dTotals, "###,###,###.00")
Application.StatusBar = "Ex3: File totals for " & sTextName & ": " & sFormattedNumber
Application.Cursor = xlDefault
End Sub

 

 

 

 

Main Page

Complete Auditor resources
Links | Privacy Policy | FAQ | Downloads | Trademarks
Web Page last updated on 04-20-2008
© EZ-R Stats, LLC 2005-2007