永远都是弄到 查询表的 E1?
Sub AA()
[AA1] = [AA1] + 1
MsgBox "第:" & [AA1] & "次"
Sheets("查询").[E1] = Cells([D1], "a")
End Sub
插入一个按钮控件,把下面的代码贴进去,注意你的button的名字替换掉Private Sub CommandButton1_Click()中的CommandButton1
Option Explicit
Public buttonClickCount As Integer
Private Sub CommandButton1_Click()
buttonClickCount = buttonClickCount + 1
Worksheets("Sheet3").Cells(1, 5).value = Worksheets("Sheet1").Cells(buttonClickCount, 1).value
'MsgBox (buttonClickCount)
End Sub
注意每次重新打开excel表格,按钮计数才会重置为零