很高兴啊,刚才实现了一个功能,excel的vba编程,终于可以列出所有的sheet,然后点击其中的一个,自动跳过去!代码很简单,如下:
Private Sub ListBox1_Click()
Workbooks.Application.Sheets(ListBox1.ListIndex + 1).Select
End Sub
Private Sub UserForm_Click()
ListBox1.Clear
Dim i As Integer
For i = 1 To Workbooks.Application.Sheets.Count
Set WsheetA = Workbooks.Application.Sheets(i)
Me.ListBox1.AddItem WsheetA.Name
Next i
End Sub