VB提示loop没有DO
For r = 2 To lots + 1 Application.StatusBar = "产品分大类 --- " & lots + 1 - r i = 1 If Cells(r, 10) <> "" Then Cells(r, 8) = "" Cells(r, 14) = "" End If you = False Do i = i + 1 If UCase(Mid(Cells(r, 4), 11, 7)) = "LTF1303" Then If Cells(r, 2) = (Mid(Cells(r, 4), 11, 7) & Mid(Cells(r, 4), 23, 4)) = UCase(Workbooks(progname).Sheets("Projlist").Cells(3, 5)) Then Cells(r, 1) = UCase(Workbooks(progname).Sheets("Projlist").Cells(3, 6)) ElseIf Cells(r, 2) = (Mid(Cells(r, 4), 11, 7) & Mid(Cells(r, 4), 23, 4)) = UCase(Workbooks(progname).Sheets("Projlist").Cells(4, 5)) Then Cells(r, 1) = UCase(Workbooks(progname).Sheets("Projlist").Cells(4, 6)) Else If UCase(Mid(Cells(r, 4), 11, 7)) = UCase(Workbooks(progname).Sheets("Projlist").Cells(i, 3)) Then Cells(r, 1) = Workbooks(progname).Sheets("Projlist").Cells(i, 2) ' Cells(r, 3) = Left(Trim(Cells(r, 3)), 9) you = True Exit Do End If End If Loop Until Workbooks(progname).Sheets("Projlist").Cells(i, 3) = ""