Vous êtes sur la page 1sur 2

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.

Node)
If Node.Key = "KARYA AM" Or Node.Key = "FALSAFAH" Or Node.Key = "AGAMA" _
Or Node.Key = "SAINS KEMASYARAKATAN" Or Node.Key = "BAHASA" Or Node.Key = "SAINS TULEN" _
Or Node.Key = "TEKNOLOGI" Or Node.Key = "KESENIAN" _
Or Node.Key = "KESUSASTERAAN" Or Node.Key = "GEOGRAFI DAN SEJARAH AM" Then

Else

Dim LastRowID As Long


LastRowID = DDC2.Cells(DDC2.Rows.Count, "A").End(xlUp).Row

For Each ID In Range(DDC2.Cells(2, 1), DDC2.Cells(LastRowID, "A"))

If ID.Value = Node.Text Then

Label2.Caption = ID.Offset(, 1).Value


Label4.Caption = ID.Offset(, 2).Value
Label6.Caption = ID.Offset(, 3).Value
Label8.Caption = ID.Offset(, 4).Value
Label10.Caption = ID.Offset(, 5).Value
Label12.Caption = ID.Offset(, 6).Value
Label14.Caption = ID.Offset(, 7).Value
Label16.Caption = ID.Offset(, 8).Value
Label18.Caption = ID.Offset(, 9).Value
Label20.Caption = ID.Offset(, 10).Value

'TextBox1.Text = ID.Offset(, 5).Value

End If

Next ID

End If
End Sub

Sub FillChildNodes(ByVal col As Integer, ByVal continent As String)

Dim LastRow As Long

With DDC1
LastRow = .Cells(.Rows.Count, col).End(xlUp).Row
End With

Dim counter As Integer


counter = 1
For Each pertama In Range(Cells(2, col), Cells(LastRow, col))
TreeView1.Nodes.Add DDC1.Cells(1, col).Value, tvwChild, continent + CStr(counter), pertama
counter = counter + 1

Next pertama

End Sub

Vous aimerez peut-être aussi