- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
回復 4# joe80502
回填資料到工作表中,可利用ControlSource屬性- Private Sub UserForm_Initialize()
- With ActiveSheet
- For Each a In .Range("A:A").SpecialCells(xlCellTypeConstants)
- With Me.Controls.Add("Forms.TextBox.1")
- .Top = i * 22
- .Height = 20
- .Width = 60
- .Left = 10
- .Value = a
- End With
- With Me.Controls.Add("Forms.ComboBox.1")
- .Top = i * 22
- .Height = 20
- .Width = 60
- .Left = 50
- .ControlSource = a.Offset(, 5).Address '連結儲存格
- .RowSource = 工作表1.[A1:A7].Address '清單來源
- End With
- i = i + 1
- Next
- End With
- End Sub
複製代碼 |
|