- Katılım
- 28 Kasım 2007
- Mesajlar
- 919
- Excel Vers. ve Dili
- Office 2010 İngilizce
Merhaba arkadaşlar,
yukarıdaki kod ile listbox1 e bilgi gerirebiliyorum. Amacım aynı butonu kullanmak sureti ile listbox bilgiler geldiğinde, userform üzrindeki TextBox6 nın içinde seçtiğim iki tarih aralığının toplamını getirtmek istiyorum.
ListBox1.Column(3)
ListBox1.RowSource = "B2:F" & [a65536].End(3).Row
ListBox1.Column(2)
Kod:
Private Sub CommandButton7_Click()
Dim ilktar As Date, sontar As Date
Dim i As Long, a As Long, k As Byte, isim As String
ilktar = DateValue(DTPicker1.Value)
sontar = DateValue(DTPicker2.Value)
ListBox1.RowSource = vbNullString
ReDim myarr(1 To 5, 1 To 1)
For i = 2 To Cells(65536, "F").End(xlUp).Row
If ComboBox4.Value = "" Then
isim = UCase(Replace(Replace(Cells(i, "B").Value, "i", "İ"), "ı", "I"))
Else
isim = UCase(Replace(Replace(ComboBox4.Value, "i", "İ"), "ı", "I"))
End If
If Cells(i, "F").Value >= ilktar And _
Cells(i, "F").Value <= sontar And isim = _
UCase(Replace(Replace(Cells(i, "B").Value, "i", "İ"), "ı", "I")) Then
a = a + 1
ReDim Preserve myarr(1 To 5, 1 To a)
For k = 1 To 5
myarr(k, a) = Cells(i, k + 1).Value
Next k
myarr(5, a) = Format(myarr(5, a), "dd/mm/yyyy")
myarr(3, a) = Format(myarr(3, a), "#,##0.00")
End If
Next i
If a > 0 Then
ListBox1.Column = myarr
End If
Erase myarr
End Sub
ListBox1.Column(3)
ListBox1.RowSource = "B2:F" & [a65536].End(3).Row
ListBox1.Column(2)