これは、委員会のレポートのコードの文字列です。毎日問題なく正常に動作し、13 日に最後に実行されました。
今朝、私は を受け取っていRun Time Error 13 Type Mismatch
ます。
理由はわかりませんが、デバッグすると、次のセクションが強調表示されます。
If UCase(Cells(i, 1).Value = "200265 - MP"
それで
再入力しようとしましたが、入力すると、単語のエラーが表示されます次に、次のように述べています。
Compile error: Expected: list seperator or )
どうすればこれを実行できますか?
コードは次のとおりです。
Sheets("Errors").Select
Cells.Select
Selection.Sort Key1:=Range("A2"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Sheets("Errors").Select
With Sheets("Errors")
lastrow = .Range("C" & Rows.Count).End(xlUp).Row
End With
For i = lastrow To 1 Step -1
Cells(i, 1).Select
If UCase(Cells(i, 1).Value = "200265 - MP" Then
Rows(i).Select
Selection.Cut
Sheets("Temp").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Sheets("Errors").Select
End If
If UCase(Cells(i, 1).Value) = "160850 - TP" Then
Rows(i).Select
Selection.Cut
Sheets("Temp").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Sheets("Errors").Select
End If
If UCase(Cells(i, 1).Value) = "170566 - VB" Then
Rows(i).Select
Selection.Cut
Sheets("Temp").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Sheets("Errors").Select
End If
If UCase(Cells(i, 1).Value) = "201447 - JB" Then
Rows(i).Select
Selection.Cut
Sheets("Temp").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Sheets("Errors").Select
End If
If UCase(Cells(i, 1).Value) = "202006 - BL" Then
Rows(i).Select
Selection.Cut
Sheets("Temp").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Sheets("Errors").Select
End If
If UCase(Cells(i, 1).Value) = "203646 - MM" Then
Rows(i).Select
Selection.Cut
Sheets("Temp").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Sheets("Errors").Select
End If
If UCase(Cells(i, 1).Value) = "203917 - KT" Then
Rows(i).Select
Selection.Cut
Sheets("Temp").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Sheets("Errors").Select
End If