我需要填写目录。
我想为此输入Userform
,点击add new product
中的按钮Textboxes
将插入特定列
Private Sub CommandButton1_Click()
Sheet3.Cells.Rows.Insert
Sheet3.Cells(25, 27).Value = TextBox1.Value
End Sub
答案 0 :(得分:2)
这是你在尝试的吗?
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