Professional Documents
Culture Documents
2 3 4
2 3 4
' "보고마지막" 탐색
lastRow = Me.Range("보고마지막").Row - 1
' F 열 변동 시 "보고값" 계산
If Not Intersect(Target, Me.Columns("F")) Is Nothing Then
sumValue = 0 ' sumValue 초기화
Set rng = Me.Range("F11:F" & lastRow) ' F 열 변동 감지
For Each cell In rng
If (cell.MergeCells And cell.Interior.Color = white) Or _
(Not cell.MergeCells And cell.Interior.Color = white) Then
sumValue = sumValue + CDbl(cell.Value)
End If
Next cell
Me.Range("보고값").Value = sumValue ' 결과값 "보고값" 입력
End If
' "연구마지막" 탐색
lastRow = Me.Range("연구마지막").Row - 1
' E 열 변동 시 "인원값" 계산
If Not Intersect(Target, Me.Columns("E")) Is Nothing Then
sumValue = 0 ' sumValue 초기화
Set rng = Me.Range("E11:E" & lastRow) ' E 열 변동 감지
For Each cell In rng
If (cell.MergeCells And cell.Interior.Color = white) Or _
(Not cell.MergeCells And cell.Interior.Color = white) Then
sumValue = sumValue + CDbl(cell.Value)
End If
Next cell
Me.Range("인원값").Value = sumValue ' 결과값 "인원값" 입력
End If