중첩 For 루프를 작성했으며 조건이 충족 되더라도 For 루프 코드를 실행하지 않습니다. 가장 바깥 쪽 For 루프를 주석 처리했지만 내부 루프도 작동하지 않습니다. I 2007Excel 2007의 VBA는 중첩 된 for 루프를 실행하지 않습니다.
Sub CalcAll()
Dim a As Integer
a = 10
Dim b As Integer
b = 10
For a = 10 To a = (Range("B" & Rows.Count).End(xlUp).Row) Step 1
For b = 10 To b = (Worksheets("DistanceLookupTable").Cells(2, Sheet1.Columns.Count).End(xlToLeft).Column) Step 1
If IsEmpty(Cells(a, i).Value) Then
Exit Sub
Else
'Lots of code reading values from the worksheet and printing
'calculated values to the worksheet
End If
Next b
Next a
End Sub
주셔서 감사합니다 도움을 Excel에서 일하고 있어요
귀하의 루프는 다음과 같이 작성해야
당신은'셀 (a, i)'을 가지고 있지만 어디에도 'i'가 정의되어 있지 않습니다. '셀 (a, b)'이어야합니까? –