티스토리 뷰
Function continue_cu_or_ncu(rng As Range, chul As String)
Dim cnt, maxx
Dim oldv
Dim c, r
Dim i, ils
maxx = 0
cnt = 0
If chul = "mcu" Then
oldv = 0
Else
oldv = 1
End If
For Each target In rng
If chul = "mcu" Then
If target.Value = 0 Or target.Value = "" Then
cnt = cnt + 1
If oldv <> 0 Or oldv <> "" Then
If maxx < cnt Then
maxx = cnt
End If
End If
Else
If maxx < cnt Then
maxx = cnt
End If
cnt = 0
End If
Else
If target.Value > 0 Then
cnt = cnt + 1
If oldv > 0 Then
If maxx < cnt Then
maxx = cnt
End If
End If
Else
If maxx < cnt Then
maxx = cnt
End If
cnt = 0
End If
End If
oldv = target.Value
Next
continue_cu_or_ncu = maxx
End Function
.
'엑셀' 카테고리의 다른 글
Area_Init (0) | 2018.11.23 |
---|---|
Row 숨기기, 해제 (0) | 2018.11.23 |
엑셀 vba 폴더 생성 불가능한 문자 대체 (0) | 2018.11.22 |
엑셀 매크로 VBA 나의 함수 tr_InStr_2글자( (0) | 2018.11.21 |
리본메뉴가 사라졌을때... 큰 버튼들... (0) | 2018.11.21 |