【发布时间】:2015-11-23 02:14:21
【问题描述】:
有人可以帮我让我的用户表单从 cal 工作表提交到此表中吗?
Private Sub cmdbutton_submitform_Click()
Dim emptyRow As Long
'Make Sheet2 active
Sheet2.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = txtbox_number.Value
Cells(emptyRow, 2).Value = txtbox_rank.Value
Cells(emptyRow, 3).Value = txtbox_Name.Value
Cells(emptyRow, 4).Value = txtbox_height.Value
Cells(emptyRow, 5).Value = txtbox_weight.Value
Cells(emptyRow, 6).Value = txtbox_right_rm.Value
Cells(emptyRow, 7).Value = txtbox_left_rm.Value
End Sub
【问题讨论】:
-
我可以截屏我正在使用的 vba 代码
-
Private Sub cmdbutton_submitform_Click() Dim emptyRow As Long '使 Sheet2 处于活动状态 Sheet2.Activate '确定 emptyRow emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1 '传输信息 Cells(emptyRow , 1).Value = txtbox_number.Value 单元格(emptyRow, 2).Value = txtbox_rank.Value 单元格(emptyRow, 3).Value = txtbox_Name.Value 单元格(emptyRow, 4).Value = txtbox_height.Value 单元格(emptyRow, 5 ).Value = txtbox_weight.Value Cells(emptyRow, 6).Value = txtbox_right_rm.Value Cells(emptyRow, 7).Value = txtbox_left_rm.Value End Sub
-
似乎是什么问题?您收到错误或...?