非常新的宏,这是我的第一个......
因此,我建立一个excel表单,我们将在其中输入信息(UpScoreAudit),单击一个按钮,该信息将被复制到同一工作簿上的另一个工作表(UpScores)上的新行。我在这里搜索过,并找到了一些帮助,但是当我点击按钮时没有任何反应。这就是我目前所拥有的:
Sub OnClick()
Dim refTable As Variant, trans As Variant
refTable = Array("A=C3", "B=C4", "C=C5", "D=C6", "E=C7", "F=C9", "G=D11", "H=D13", "J=E15")
Dim Row As Long
Row = Worksheets("UpScores").UsedRange.Rows.Count + 1
For Each trans In refTable
Dim Dest As String, Field As String
Dest = Trim(Left(trans, InStr(1, trans, "=") - 1)) & Row
Field = Trim(Right(trans, Len(trans) - InStr(1, trans, "=")))
Worksheets("UpScoreAudit").Range(Dest).Value = Worksheets("UpScores").Range(Field).Value
Next
End Sub
非常感谢任何帮助
答案 0 :(得分:0)
尝试命名子CommandButton1_Click(),其中CommandButton1是按钮的名称