返回列表 上一主題 發帖

[發問] 執行錯誤階段13-型態不符合

[發問] 執行錯誤階段13-型態不符合

DEAR ALL 大大
簡單之程式如下
If Sheet48.Cells(M, 16) = Sheet10.Range("G168") And (Sheet48.Cells(M, 10) - Sheet10.Range("B84") = 0) Then
出現
執行錯誤階段13-型態不符合
?????
有哪位大大知道原因為何???

程式如下
Sub PCBCTREADGats7ALL材編轉置A()
Sheet48.Visible = True
Sheet49.Visible = True
Sheet49.[A2:E65536].ClearContents
X = Sheet48.[G65536].End(xlUp).Row
Y = Sheet49.[A65536].End(xlUp).Row + 1
For M = 2 To X
If Sheet48.Cells(M, 10) - Sheet10.Range("B84") = 0 And Sheet48.Cells(M, 11) - Sheet10.Range("B85") < 0 And Sheet48.Cells(M, 12) - Sheet10.Range("B85") >= 0 And Sheet48.Cells(M, 13) - Sheet10.Range("B86") = 0 And Sheet48.Cells(M, 14) - Sheet10.Range("B87") < 0 And Sheet48.Cells(M, 15) - Sheet10.Range("B87") >= 0 Then
Sheet49.Cells(Y, 1) = Sheet48.Cells(M, 7)
Sheet49.Cells(Y, 2) = Sheet48.Cells(M, 8)
Sheet49.Cells(Y, 3) = Sheet48.Cells(M, 1)
Sheet49.Cells(Y, 4) = Sheet48.Cells(M, 2)
Sheet49.Cells(Y, 5) = Sheet48.Cells(M, 3)
Y = Y + 1
End If
Next
End Sub

TOP

感謝  stillfish00 大大
1.瞭解.用您之方式已找出問題點
   THANKS*10000

TOP

        靜思自在 : 小事不做、大事難成。
返回列表 上一主題