Board logo

標題: [發問] 執行錯誤階段13-型態不符合 [打印本頁]

作者: rouber590324    時間: 2019-1-10 10:00     標題: 執行錯誤階段13-型態不符合

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

程式如下
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
作者: stillfish00    時間: 2019-1-10 10:58

回復 1# rouber590324
發生錯誤時偵錯
看M值是多少?
看該M值下,這幾個儲存格的內容分別是什麼?
作者: rouber590324    時間: 2019-1-10 13:32

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




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)