当前位置: 代码迷 >> VB >> 报错:loop没有do,小弟我看了好多次,没看出来
  详细解决方案

报错:loop没有do,小弟我看了好多次,没看出来

热度:6337   发布时间:2013-02-26 00:00:00
报错:loop没有do,我看了好多次,没看出来
    Do While MyFile <> ""
      
        Workbooks.Open Filename:=Mypath & MyFile

        Sheets(1).Select
    
        i = 13
        k = 1
        
        'find the filter line
        Do While k < 50
            If InStr(ActiveSheet.Cells(k, 6).Value, "Screen") <> 0 Then
                  i = k + 3
                  Exit Do
            End If
            k = k + 1
        Loop
        
        
        Do While ActiveSheet.Cells(i, 6) <> "" Or ActiveSheet.Cells(i, 7) <> "" Or ActiveSheet.Cells(i, 8) <> ""
        
                If ActiveSheet.Cells(i, 10) = "1" Then
                    If Workbooks("PSAFinalString.xls").Sheets("TranslaterPSA").Cells(j, 1) = "" Then
                         Workbooks("PSAFinalString.xls").Sheets("TranslaterPSA").Cells(j, 1) = ActiveSheet.Cells(i, 6)
                         Workbooks("PSAFinalString.xls").Sheets("TranslaterPSA").Cells(j, 2) = ActiveSheet.Cells(i, 7)
                         Workbooks("PSAFinalString.xls").Sheets("TranslaterPSA").Cells(j, 4) = ActiveSheet.Cells(i, 24)
                         Workbooks("PSAFinalString.xls").Sheets("TranslaterPSA").Cells(j, TranslaterColumn) = ActiveSheet.Cells(i, 42)
                    Else
                        If Workbooks("PSAFinalString.xls").Sheets("TranslaterPSA").Cells(j, 1) <> ActiveSheet.Cell(i, 6) Then
                        MsgBox ("Error! ID " & Workbooks("PSAFinalString.xls").Sheets("TranslaterPSA").Cells(j, 1) & " is not match with The translater books.")
  相关解决方案