我有以下代码:VLOOKUP,EXCEL,错误438“对象不支持此属性或方法”
- 它应该进入一个名为“闪电侠”片,并获得第i个2位数字值,并检索活动单元右侧偏移4列中的值。
- 然后交换到同一工作簿中名为“Sheet1”的工作表,并使用垂直查找功能查找检索值并将该值返回到该单元右侧的4列。
但是当我运行它下面的脚本停止工作在:
MsgBox (ActiveSheet.VLookup(LookFor, "A:A", 4, True))
和VBA抛出error 438 object doesn't support this property or method
没有人知道为什么有一个例外?
' Begin lookup :
Dim i As Integer, designator As String, LookFor As String
Flash.Activate
ActiveSheet.Range("C3").Select
For i = 3 To lastUsedCellInRow("C")
designator = "C" + CStr(i)
Dim cellVal As String
cellVal = ActiveSheet.Range(designator).Value()
If (Len(cellVal) <= 2 And IsNumeric(cellVal)) Then
LookFor = ActiveSheet.Range(designator).Offset(0, 4).Value()
RawData.Activate
MsgBox (ActiveSheet.VLookup(LookFor, "A:A", 4, True))
End If
Next i
'activesheet.worksheetfunction.vlookup' – 2012-02-12 00:04:45
@TomIngram嗯...这听起来像它可以工作,但是当我代替我的方法与它仍返回'438'错误... – franklin 2012-02-12 00:20:39
尝试'Application.WorksheetFunction .V Lookup' – Cutter 2012-02-12 01:10:54