giúp với combobox (1 người xem)

  • Thread starter Thread starter cmkhoa
  • Ngày gửi Ngày gửi
Liên hệ QC

Người dùng đang xem chủ đề này

cmkhoa

Thành viên mới
Tham gia
19/11/11
Bài viết
7
Được thích
0
Dim i As Integer
i = 8
Do Until Sheet6.Cells(i, 2).Value = "Tong"
i = i + 1
Loop
UserForm5.ComboBox1.List = Range(Cells(8, 2), Cells(i, 2))

Mình muốn list của combobox lấy từ vùng B8:Bi
 
Bạn thử dùng cách này xem sao:

UserForm5.ComboBox1.ListFillRange = "B8:B" & i
 
Upvote 0
Bạn xem cái này:
ListFillRange Property [Excel 2003 VBA Language Reference]
Returns or sets the worksheet range used to fill the specified list box. Setting this property destroys any existing list in the list box. Read/write String.
Remarks
Microsoft Excel reads the contents of every cell in the range and inserts the cell values into the list box. The list tracks changes in the range's cells.
If the list in the list box was created with the AddItem method, this property returns an empty string ("").
Example
This example adds a list box to worksheet one and sets the fill range for the list box.
With Worksheets(1)
Set lb = .Shapes.AddFormControl(xlListBox, 100, 10, 100, 100)
lb.ControlFormat.ListFillRange = "A1:A10"
End With
 
Upvote 0
Web KT

Bài viết mới nhất

Back
Top Bottom