엑셀 2007 에서 매크로 쓰는 도중에 13런타임 오류 발생. 형식 일치하지 않는다고 나와요.
그리고 그 후에는 microsoft visual basic -- 공용(코드) 창이 떠서 아래 처럼 나오는데요.
6번째 줄 ----- If Cells(i, j).Value - Date < 0 Then 에만 노란줄이 쳐저있어요.
제 생각에는 저게 문제여서 매크로 실행할떄 에러가 나는거 같은데, 어떻게해야 에러가 안뜨는지 알려주시면 감사하겠습니다.
For j = 1 To 시트열수_
If Sheets("시트구조").Cells(j, 시트명열_ + 4).Value = "mm/dd" Then
For i = 2 To End_of_row
Cells(i, j).Select
If Selection.Font.ColorIndex <> Selection.Interior.ColorIndex Then
If Cells(i, j).Value - Date < 0 Then
Selection.Font.Bold = Sheets("메인").Cells(14, 13).Value
Selection.Font.ColorIndex = 과거색_
ElseIf Cells(i, j).Value - Date = 0 Then
Selection.Font.Bold = Sheets("메인").Cells(15, 13).Value
Selection.Font.ColorIndex = 오늘색_
ElseIf (Cells(i, j).Value - Date > 0) And _
(Cells(i, j).Value - Date <= 미래구분일수_) Then
Selection.Font.Bold = Sheets("메인").Cells(16, 13).Value
Selection.Font.ColorIndex = 가까운미래색_
ElseIf Cells(i, j).Value - Date > 미래구분일수_ Then
Selection.Font.Bold = Sheets("메인").Cells(17, 13).Value
Selection.Font.ColorIndex = 먼미래색_
End If
End If
Next i
End If
Next j
End Sub