vba listbox ColumnHeads的表頭
- 帖子
- 8
- 主題
- 3
- 精華
- 0
- 積分
- 11
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office2010
- 閱讀權限
- 10
- 註冊時間
- 2016-5-24
- 最後登錄
- 2016-7-9
|
vba listbox ColumnHeads的表頭
嗨,大家晚安 :
想請教一下VBA表單裡的listbox,切割好欄位後,怎麼新增表頭的文字上去,如下圖,
Google一些文章,都沒有看到合適的,特來請教大家,謝謝
___
|
|
|
|
|
|
|
|
- 帖子
- 8
- 主題
- 3
- 精華
- 0
- 積分
- 11
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office2010
- 閱讀權限
- 10
- 註冊時間
- 2016-5-24
- 最後登錄
- 2016-7-9
|
回復 owenchen0911
listbox,切割好欄位後???
ListBox 要顯示ColumnHeads,清單的來源必需用.RowSour ...
GBKEE 發表於 2016-6-2 07:57 
Hi,
我的code如下,這樣子子項目可以加進去,那麼頭還可以用 "ColumnHeads"嗎??謝謝- ListBox1.ColumnCount = 7
- ListBox1.ColumnHeads = True
- '增加項目進去
- IListRow = ListBox1.ListCount
- ListBox1.AddItem ComboBox_drink_name
-
- ListBox1.List(IListRow, 1) = priceArray(ComboBox_drink_name.ListIndex)
- ListBox1.List(IListRow, 2) = ComboBox_number
- ListBox1.List(IListRow, 3) = ComboBox_number * priceArray(ComboBox_drink_name.ListIndex)
- ListBox1.List(IListRow, 4) = ComboBox_ice
- ListBox1.List(IListRow, 5) = ComboBox_sugar
- ListBox1.List(IListRow, 6) = ComboBox_takeout
-
- xItemCount = xItemCount + 1
複製代碼 |
|
|
|
|
|
|
|