find一个列(“名称”)和填充公式

Sheets("DATA").Rows(2).Find(What:="Apple", LookIn:=xlValues, _ LookAt:=xlWhole).Offset(1, 0).Value = "=A3-B3" Selection.FillDown 

我想在第二行find一列“苹果”,并填入公式“A3-B3”
会像.value="=A3-B3".filldown工作?
谢谢!

除了我上面的评论,试试这个。 我已经评论了代码。 如果你发现任何令人困惑的事情,请告诉我

 Sub Sample() Dim ws As Worksheet Dim LRow As Long Dim aCell As Range '~~> Set this to the relevant sheet Set ws = ThisWorkbook.Sheets("Data") With ws '~~> Find Last Row LRow = .Range("A" & .Rows.Count).End(xlUp).Row '~~> Find the cell which has "Apple" Set aCell = .Rows(2).Find(What:="Apple", LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) '~~> if found, then enter the formula till the last row IN ONE GO If Not aCell Is Nothing Then .Range(.Cells(3, aCell.Column), .Cells(LRow, aCell.Column)).Formula = "=A3-B3" End If End With End Sub