toannguyen89
Thành viên mới

- Tham gia
- 17/11/09
- Bài viết
- 21
- Được thích
- 1
như tiêu đề ở trên code của e đây
private Sub Frame1_Click()
End Sub
Private Sub Lb13_Click()
End Sub
Private Sub Lb17_Click()
End Sub
Private Sub UserForm_Initialize()
With Sheet1.Range("A1").CurrentRegion
ComboBox1.List() = WorksheetFunction.Transpose(.Resize(1))
End With
ComboBox1.Value = ComboBox1.List(0, 0)
End Sub
Private Sub ComboBox1_Change()
With Sheet1.Range("A1").CurrentRegion
ListBox1.RowSource = Intersect(.Cells, .Offset(1, ComboBox1.ListIndex)).Resize(, 1).Address
End With
End Sub
Private Sub ListBox1_Click()
Dim i As Long
With Sheet1.Range("A1").CurrentRegion
For i = 1 To 6
Me.Controls("Lb" & Format(i + 6, "00")).Caption = .Cells(ListBox1.ListIndex + 2, i)
Next
For i = 7 To 11
Me.Controls("Lb" & Format(i + 11, "00")).Caption = .Cells(ListBox1.ListIndex + 2, i)
Next
End With
End Sub
Private Sub TextBox1_Change()
On Error Resume Next
With Range(ListBox1.RowSource).Resize(, 1)
ListBox1.Selected(.Find(TextBox1, , , xlPart).Row - .Row) = True
End With
End Sub
private Sub Frame1_Click()
End Sub
Private Sub Lb13_Click()
End Sub
Private Sub Lb17_Click()
End Sub
Private Sub UserForm_Initialize()
With Sheet1.Range("A1").CurrentRegion
ComboBox1.List() = WorksheetFunction.Transpose(.Resize(1))
End With
ComboBox1.Value = ComboBox1.List(0, 0)
End Sub
Private Sub ComboBox1_Change()
With Sheet1.Range("A1").CurrentRegion
ListBox1.RowSource = Intersect(.Cells, .Offset(1, ComboBox1.ListIndex)).Resize(, 1).Address
End With
End Sub
Private Sub ListBox1_Click()
Dim i As Long
With Sheet1.Range("A1").CurrentRegion
For i = 1 To 6
Me.Controls("Lb" & Format(i + 6, "00")).Caption = .Cells(ListBox1.ListIndex + 2, i)
Next
For i = 7 To 11
Me.Controls("Lb" & Format(i + 11, "00")).Caption = .Cells(ListBox1.ListIndex + 2, i)
Next
End With
End Sub
Private Sub TextBox1_Change()
On Error Resume Next
With Range(ListBox1.RowSource).Resize(, 1)
ListBox1.Selected(.Find(TextBox1, , , xlPart).Row - .Row) = True
End With
End Sub