0
코드를 실행하려고하면 런타임 오류 '13': 형식이 일치하지 않습니다. 디버그는 'IF'및 'ElseIF'문을 강조하지만 실수가 어디인지는 알 수 없습니다. 어떤 도움을 주시면 감사하겠습니다. 감사합니다VBA 런타임 오류 '13': 형식이 일치하지 않습니다.
Dim lColumn As Long
lColumn = ws.Cells(2, Columns.Count).End(xlToLeft).Column
Dim rgMonth As Range
Dim rgTaxExp As Range
Dim i As Long, j As Long
Set rgTaxExp = Range(Cells(lRow, 10), Cells(lRow, lColumn))
Set rgMonth = Range(Cells(2, 10), Cells(2, lColumn))
For i = 1 To rgMonth.Rows.Count
For j = 1 To rgMonth.Columns.Count
If Month(date2) >= Month(rgMonth.Cells(i, j).Value) Then 'Runtime Error '13':_
Type Mismatch
Cells(lRow, 9).Copy rgTaxExp.Cells(i, j)
ElseIf Month(date2) < Month(rgMonth.Cells(i, j).Value) Then 'Runtime Error '13':_
Type Mismatch
rgTaxExp.Cells(i, j) = 0
여기서/date /는 어떻게 선언/정의됩니까? – ApplePie
그것은 일로 어둡게 DATE1 상기 여러 줄 선언있어 날짜 1 = .Cells (lRow 5) 날짜 날짜 2 = .Cells (lRow 6) .Value '참조 DateDiff = ("m"날짜 1로 .Value 희미한 DATE2 , date2) – user2532363
코드가 실패 할 때 rgMonth.Cells (i, j)의 값은 무엇입니까? – ApplePie