- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
12#
發表於 2012-8-13 16:20
| 只看該作者
回復 11# user999
ListBox1 後 若要取消, 只能輸0表示,無法恢復未選狀態吧!
修改如下- Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
- Dim ListText As Integer, i As Integer
- i = ListBox1.ListIndex
- ListText = Val(ListBox1.List(i, 1))
- ListText = Application.InputBox("請輸入數字 : ", ListBox1.List(i), ListText, Type:=1)
- If ListText >= 0 Then
- If ListText > 0 Then ListBox1.List(i, 1) = ListText '>0 輸入數值
- If ListText = 0 Then ListBox1.List(i, 1) = "" '=0 清除內容
- End If
- Ar(ComboBox2.ListIndex) = Application.Transpose(Application.Transpose(ListBox1.List))
- '品別陣列的索引之陣列 = ListBox1
- ITEM(ComboBox1.ListIndex) = Ar '店別陣列的索引之陣列 = 品別陣列
- 顯示計數
- End Sub
複製代碼 |
|