EXCEL中,B1=A1,A1随时变化,B1能自动保存。

来源:百度知道 编辑:UC知道 时间:2024/06/06 14:43:29
A1随时变化,但变化的过程要记录下来。即A1输入第一次,结果保存在B1,变化第二次,保存在B2,以此类推。
看不大明白,如果把A1换为B3,B1换为I。那该怎么弄呢

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$3" Then
Dim x
x = Application.WorksheetFunction.CountA([I:I])
Cells(x + 1, 9) = [B3]
End If
End Sub

相应地方作更改就可以,最好能理解它的原理,这样才好,要渔而不要鱼也!