- 帖子
- 258
- 主題
- 77
- 精華
- 0
- 積分
- 385
- 點名
- 0
- 作業系統
- Win7
- 軟體版本
- Office2010
- 閱讀權限
- 20
- 性別
- 男
- 來自
- Taiwan
- 註冊時間
- 2010-8-8
- 最後登錄
- 2021-1-25
|
7#
發表於 2014-12-24 17:26
| 只看該作者
本帖最後由 yangjie 於 2014-12-24 17:31 編輯
回復 6# GBKEE
謝謝GBKEE版大
ListBox2.Clear
wb1.Activate
With Sheets("新生資料")
If TextBox11 = 0 Then
row1 = .Cells(65536, 5).End(xlUp).Row
If row1 < 2 Then Exit Sub
Dim mystr As String
With Application.Names.Add("Tmp", .Range(.Cells(2, 1), .Cells(row1 - 5, 11)))
mystr = .RefersTo
.Delete
End With
With ListBox2
.ColumnCount = 11
.RowSource = mystr
.ColumnHeads = True
End With
'要加入.Range(.Cells(row1 - 1, 1), .Cells(row1 - 1, 11))
With ListBox2
.AddItem
.RowSource = .Range(.Cells(row1 - 1, 1), .Cells(row1 - 1, 11))
End With
End With
偵錯說:沒有此成員或....無法加入 或移除部分
另有一問題 當ListBox2_Click
MsgBox ListBox2.List(ListIndex, 3)
MsgBox ListBox2.List(ListIndex, ?)如何可找出該列的 Row? |
|