返回列表 上一主題 發帖

如何讓ListBox可以隨著儲存格內的數字變化

回復 8# syuan

你的意思是選一張表的對吧? 可以這樣的

dim strsht as string
strsht ="sheet1"

.....
ElseIf UserForm1.ListBox1.ListIndex = 6 And UserForm1.ListBox2.ListIndex = 1 And UserForm1.ListBox3.ListIndex = 1 Then
With UserForm2.ListBox1
     .RowSource = worksheets(strsht).range("m5:n8").address(,,,1)
     .ColumnCount = 2
     .ColumnWidths = "100"
End With
UserForm2.Show

以上回傳sheet1
把strsht="sheet1"  換成 "sheet2" 就會回傳sheet2 的
懂得發問,答案就會在其中

今日の一秒は  明日にない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        靜思自在 : 心中常存善解、包容、感思、知足、惜福。
返回列表 上一主題