I'm trying to set the ActiveCell's value as follows:
This is my code, I get an exception without any helpful information.
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
Any help would be appreciated.
Cheers
Correct the two small errors:
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.