- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
回復 1# syuan
if敘述沒設定到jp
改成- Private Sub ListBox3_Click()
- UserForm2.ListBox1.Clear
- Set TA = Sheets("sheet1").Range("a2:b6")'設置變數TA
- Set JP = Sheets("sheet1").Range("A10:B14")'設置變數JP
- If UserForm1.ListBox1.ListIndex = 0 And UserForm1.ListBox2.ListIndex = 0 And UserForm1.ListBox3.ListIndex = 0 Then
- With UserForm2.ListBox1
- .ColumnCount = TA.Columns.Count
- .ColumnWidths = "100"
- .List = TA.Value
- End With
- UserForm2.Show
- '----------------------------------------------------
- ElseIf UserForm1.ListBox1.ListIndex = 1 And UserForm1.ListBox2.ListIndex = 0 And UserForm1.ListBox3.ListIndex = 0 Then
- UserForm2.ListBox1.Clear
- With UserForm2.ListBox1
- .ColumnCount = JP.Columns.Count
- .ColumnWidths = "100"
- .List = JP.Value
- End With
- UserForm2.Show
- Else
- MsgBox "找不到檔案"
- End If
- End Sub
複製代碼 |
|