我收到運行時錯誤“438”:物件不支持 IF 陳述句中的此屬性或方法。如果滿足所有 4 個 if 陳述句,我正在嘗試將資料從一張表復制到另一張表。
Sub update_cell1()
Dim lRow As Long
lRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To lRow
If Worksheets("TEST").Cells(i, 5).vlaue = Worksheets("Cell_1").cell(1, 2).Value Then 'B1
If Worksheets("TEST").Cells(i, 1).vlaue = Worksheets("Cell_1").cell(1, 1).Value Then 'A1
If Worksheets("TEST").Cells(i, 6).vlaue <> "" Then 'not blank
If Worksheets("TEST").Cells(i, 8).vlaue <> "" Then 'not blank
Worksheets("TEST").Rows(i).Copy
Worksheets("Cell_1").Active
b = 5
Worksheets("Cell_1").Cells(b 1, 1).Select
ActiveSheet.Paste
End If
End If
End If
End If
Next
Application.CutCopyMode = False
Worksheets("Cell_1").Active
End Sub
uj5u.com熱心網友回復:
Worksheets(..).Cells(...).vlaue應更正為Worksheets(..).Cells(...).Value
Worksheets(..).cells(...)應更正為Worksheets(..).Cells(...)
在 VBA 中,屬性區分大小寫。這意味著object.prop不同于object.Prop
uj5u.com熱心網友回復:
只是語法錯誤 - 使用Cells()而不是“cell()”
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/496704.html
