我正在尝试在表单上显示工作表,但直到现在我都没有成功。工作表包含 15 列和大约 2000 行。有人能帮我吗?
构建一个带有列表框和按钮的表单。然后将此代码放入表单模块中。该按钮的名称应为 CommandButton1,而列表框的名称应为 ListBox1。
最后在列表框控件上将 columncount 更改为 15。
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
' Activate the sheet that has the data you want displayed in the listbox
Sheet1.Activate
' Put the range of the data you want displayed.
' Here I used columns "A" to "O" and 2000 rows
ListBox1.RowSource = "A1:O2000"
End Sub
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句