我试图按如下方式设置ActiveCell的值:
这是我的代码,我得到一个例外而没有任何有用的信息。
ActiveCell.Value = Cells.Find(What:=ActiveCell.Offset(-1, 0).Value,
After:=Sheets("Source - Questions").Cell(1000, 3), LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious,
MatchCase:=False, SearchFormat:=False).Offset(1, 0).Value
任何帮助都将不胜感激。
干杯
答案 0 :(得分:1)
纠正两个小错误:
Sub asdf()
Dim r As Range, s As Worksheet, v As Variant
Set s = Sheets("Source - Questions")
v = ActiveCell.Offset(-1, 0).Value
Set r = s.Cells.Find(What:=v, _
After:=s.Cells(1000, 3), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False, _
SearchFormat:=False).Offset(1, 0)
ActiveCell.Value = r.Value
End Sub