با سلام
میتوانید از دستور زیر استفاده نمایید.
کد:
Private Sub CommandButton2_Click()
Dim LastRow As Long
ListBox1.Clear
ListBox1.ColumnCount = 3
'change column widhts
'ListBox1.ColumnWidths = "70;50;120,70,60,75,80,70,80,60"
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
i = 1
For Each C In Sheet1.Range("A2:A" & LastRow)
'If c.Offset(0, 2).Value = Val(ComboBox1.Value) Then
ListBox1.AddItem
' ListBox1.List(i - 1, 0) = Format(c, "hh:mm:ss") 'data
ListBox1.List(i - 1, 0) = C.Offset(0, 3) 'data
ListBox1.List(i - 1, 1) = C.Offset(0, 5) 'data
ListBox1.List(i - 1, 2) = C.Offset(0, 9) 'data
i = i + 1
'End If
Next C
End Sub
پایدار باشید میر
علاقه مندی ها (Bookmarks)