ขออนุญาติตั้งกระทู้ใหม่นะครับ
ตอนนี้เกิดปัญหาที่ว่า ไม่สามารถดึงข้อมูลจากชีท RENTER มาใส่ใน combobox ได้ครับ( Combobox แบบ 2 คอลัมภ์ )
Code: Select all
Private Sub UserForm_Initialize()
Dim cl As Range
Dim t As Range
Set ws = Worksheets("RENTER")
With Me.ListBox1
.RowSource = ""
For Each cl In Oat5.Range("A2:A" & _
Oat5.Range("A65536").End(xlUp).Row)
.AddItem cl.Value
Next cl
End With
For Each t In ws.Range("Name")
With Me.ComboBox1
.AddItem t.Value
.List(.ListCount - 1, 1) = t.Offset(0, 1).Value
End With
Next t
Me.TextBox6.Value = Format(Calendar1, "Medium Date")
End Sub
โดยส่วนที่เกี่ยวข้องจะมี
Code: Select all
Dim t As Range
Set ws = Worksheets("RENTER")
For Each t In ws.Range("Name")
With Me.ComboBox1
.AddItem t.Value
.List(.ListCount - 1, 1) = t.Offset(0, 1).Value
End With
Next t
ตอนนี้แจ้ง Error subscript out of range อีกแล้วครับ
ช่วยดูให้หน่อยครับ ขอบคุณครับ
Password VBA : 1150 ครับ
You do not have the required permissions to view the files attached to this post.