|
'사용자 지정 함수
' 시작일
'=get_start_end_day($D$3:$AS$3,$D4:$AS4,"start")
' 종료일
'=get_start_end_day($D$3:$AS$3,$D4:$AS4,"end")
'---------------------------------------------------------------------------------------------------
Function get_start_end_day(vDate As Range, vTarget As Range, startOrEnd As String) As Variant
'---------------------------------------------------------------------------------------------------
Application.Volatile
Dim blnSearch As Boolean
Dim iColor As Long
If startOrEnd = "start" Then
iColor = 6 '노랑
Else
iColor = 23 ' 파랑
End If
For c = 1 To vTarget.Cells.Count
If vTarget.Cells(c).Interior.ColorIndex = iColor Then
blnSearch = True
Exit For
End If
Next c
'
get_start_end_day = IIf(blnSearch, vDate.Cells(c).Value, "")
End Function
|
|