|
|
|
|
|
|
'------------------------------------------------
Function nomoney(rngX As Range) As Long
'------------------------------------------------
' Dim rngX As Range: Set rngX = Range("data")
Dim iRow As Long: iRow = rngX.Rows.Count / 3
Dim rngY As Range: Set rngY = rngX.Resize(3)
Dim iTotal As Long: iTotal = 0
Dim col As Range, icnt As Long
Dim iC As Long
Dim iCols As Long: iCols = rngY.Columns.Count
For r = 1 To iRow
icnt = 0
iC = 0
For Each col In rngY.Columns
iC = iC + 1
' 잔액이 있을 때
If col.Cells(3).Value > 0 Then
'-------------------------------------
'수금이 있을 때
If col.Cells(2).Value > 0 Then
' 수금했는데 10%이하 쬐끔만 했을 경우
If col.Cells(2).Value <= (col.Cells(3).Value + col.Cells(2).Value) * 0.1 Then
icnt = icnt + 1 '수금 안 한 걸로 간주
Else
' >=6
If icnt >= 6 Then iTotal = iTotal + 1
icnt = 0
End If
' 수금이 없을 때
Else
icnt = icnt + 1
End If
Else '잔액이 없을 시
'-------------------------------------
If col.Cells(2).Value > 0 Then icnt = 0
End If
' 6이상이면 무수급 카운팅
If iC = iCols Then
If icnt >= 6 Then iTotal = iTotal + 1
End If
Next
' 다음 항목
Set rngY = rngY.Offset(3)
'---------------------------------------------------
Next r
'---------------------------------------------------
nomoney = iTotal
End Function
|
|
[불량 게시물 신고] |
|
|
|
작성일 : 2018-11-27(16:59)
최종수정일 : 2018-11-27(17:50) |
|
|
|
|