如何通过单击按钮将值添加到Excel表中?
问题描述:
我需要填写目录。如何通过单击按钮将值添加到Excel表中?
我想打一个输入Userform
这一点,在那里通过点击按钮在Textboxes
add new product
值将被插入到特定的列
Private Sub CommandButton1_Click()
Sheet3.Cells.Rows.Insert
Sheet3.Cells(25, 27).Value = TextBox1.Value
End Sub
答
这是你想什么呢?
Private Sub CommandButton1_Click()
With Sheet3
'~~> Insert row at the 25th row.
.Rows(25).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
'~~> Add textbox value
.Cells(25, 27).Value = TextBox1.Value
End With
End Sub
插入眨眼行,更改单元格的值textbox.text – SergeyT 2013-02-19 10:39:56
你能分享你的努力和哪儿是你坚持的代码? – 2013-02-19 10:40:50
错误1004 我知道它不能工作... – SergeyT 2013-02-19 10:52:57