你不能用公式,你必须用vba。公式不能引用自身。
另一个问题是,现在每次重新计算时都会改变。所以即使有了第一个公式,这个月也不会保持静止。
如果决定使用VBA,请右键单击“工作表”选项卡并选择“查看代码”。你需要的代码看起来像这样
Private Sub Worksheet_Change(ByVal Target As Range)
'We only care if cells are changed in a certain range
If Not Intersect(Target, Me.Range("A1:G10")) Is Nothing Then
'Only do this if there's nothing in row 15 for whatever column
'was changed
If IsEmpty(Me.Cells(15, Target.Column).Value) Then
'Put the month in row 15 of the current column
Me.Cells(15, Target.Column).Value = Month(Now)
End If
End If
End Sub