TURKSEMPEROR
Yeni Üye
Merhabalar;
Excel userform u açtığım zaman resim 2'deki gibi "Listbox1" e "Mesaidata" sayfasındaki veriler geliyor.
Süzme işlemi yaparken "ComboBox2" den isim seçiyorum ve "CommandButton38" e bastığım zaman o isimle ilgili bütün verileri süzüyor ve toplamlarını,
"textbox13"-"textbox15"-"textbox16"-"textbox17"-"textbox18"-"textbox19"-"textbox20" e alıyor, fakat "CommandButton10" tıkladığım zaman yani tüm listeyi gör
tıkladığım zaman bütün veriler ancak toplamları aşağıda yazmıyor, sadece süzme işlemi yaptığım zaman toplamlarını alıyor, süzme işlemi yapmadanda toplamlarını
almam gerek,
Birde Listede kaydedilen veri en aşağaya gidiyor bunu terse çevirebilirmiyiz yani en son kaydedilen en üste gelse takibi daha kolay olacak benim için ,aşağıya kodlarını atıyorum yardımcı olabilecek var mı ? yardımlarınızı bekliyorum. şimdiden teşekkürler.
CommandButton38(Süzme İşlemi)
ListBox1(MesaiData daki verileri Listeliyor)
CommandButton10(Tümünü Gör )
ComboBox2(Personel İsimini buluyor)


Excel userform u açtığım zaman resim 2'deki gibi "Listbox1" e "Mesaidata" sayfasındaki veriler geliyor.
Süzme işlemi yaparken "ComboBox2" den isim seçiyorum ve "CommandButton38" e bastığım zaman o isimle ilgili bütün verileri süzüyor ve toplamlarını,
"textbox13"-"textbox15"-"textbox16"-"textbox17"-"textbox18"-"textbox19"-"textbox20" e alıyor, fakat "CommandButton10" tıkladığım zaman yani tüm listeyi gör
tıkladığım zaman bütün veriler ancak toplamları aşağıda yazmıyor, sadece süzme işlemi yaptığım zaman toplamlarını alıyor, süzme işlemi yapmadanda toplamlarını
almam gerek,
Birde Listede kaydedilen veri en aşağaya gidiyor bunu terse çevirebilirmiyiz yani en son kaydedilen en üste gelse takibi daha kolay olacak benim için ,aşağıya kodlarını atıyorum yardımcı olabilecek var mı ? yardımlarınızı bekliyorum. şimdiden teşekkürler.
CommandButton38(Süzme İşlemi)
Kod:
Dim i As Long, z As Object
If Me.ComboBox2.Text = "" Then Exit Sub
ComboBox3.Clear
ComboBox4.Clear
ComboBox5.Clear
deger = Array("", mesai, trh, saat, mazeret, uctrs, rapor, yillik, resmi)
For txt = 13 To 20
Me.Controls("TextBox" & txt) = ""
des = des + 1
deger(des) = Empty
Next txt
des = 0
Dim dizi()
With Worksheets("MESAİDATA")
For sat = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
If .Cells(sat, 2) Like Me.ComboBox2.Text & "*" Then
Say = Say + 1
ReDim Preserve dizi(1 To 12, 1 To Say)
For sut = 1 To 12
dizi(sut, Say) = .Cells(sat, sut)
If sut = 3 Then mesai = mesai + .Cells(sat, sut)
If sut = 4 Then trh = trh + .Cells(sat, sut)
If sut = 5 Then saat = saat + .Cells(sat, sut)
If sut = 6 Then mazeret = mazeret + .Cells(sat, sut)
If sut = 7 Then uctrs = uctrs + .Cells(sat, sut)
If sut = 8 Then rapor = rapor + .Cells(sat, sut)
If sut = 9 Then yillik = yillik + .Cells(sat, sut)
If sut = 10 Then resmi = resmi + .Cells(sat, sut)
Next sut
End If
Next sat
End With
'bütün Tarihi Süz
With Me.ListBox1
.RowSource = vbNullString
If IsEmpty(Say) Then Exit Sub
.ColumnCount = UBound(dizi())
.Column = dizi
End With
Set z = CreateObject("scripting.dictionary")
For i = 0 To ListBox1.ListCount - 1
If Not z.exists(ListBox1.List(i, 3)) Then
z.Add ListBox1.List(i, 3), Nothing
End If
ListBox1.List(i, 3) = Format(ListBox1.List(i, 3), "dd.mm.yyyy")
Next i
If z.Count > 0 Then ComboBox3.List = Application.Transpose(z.keys)
deger = Array("", mesai, trhh, saat, mazeret, uctrs, rapor, yillik, resmi)
For txt = 13 To 20
des = des + 1
Me.Controls("TextBox" & txt) = deger(des)
Next txt
'sadece Yıl Süz
With Me.ListBox1
.RowSource = vbNullString
If IsEmpty(Say) Then Exit Sub
.ColumnCount = UBound(dizi())
.Column = dizi
End With
Set z = CreateObject("scripting.dictionary")
For i = 0 To ListBox1.ListCount - 1
If Not z.exists(ListBox1.List(i, 3)) Then
z.Add ListBox1.List(i, 3), Nothing
End If
ListBox1.List(i, 3) = Format(ListBox1.List(i, 3), "dd.mm.yyyy")
Next i
If z.Count > 0 Then ComboBox4.List = Application.Transpose(z.keys)
deger = Array("", mesai, trhh, saat, mazeret, uctrs, rapor, yillik, resmi)
For txt = 13 To 20
des = des + 1
Next txt
'sadece AY Süz
With Me.ListBox1
.RowSource = vbNullString
If IsEmpty(Say) Then Exit Sub
.ColumnCount = UBound(dizi())
.Column = dizi
End With
Set z = CreateObject("scripting.dictionary")
For i = 0 To ListBox1.ListCount - 1
If Not z.exists(ListBox1.List(i, 3)) Then
z.Add ListBox1.List(i, 3), Nothing
End If
ListBox1.List(i, 3) = Format(ListBox1.List(i, 3), "dd.mm.yyyy")
Next i
If z.Count > 0 Then ComboBox5.List = Application.Transpose(z.keys)
deger = Array("", mesai, trhh, saat, mazeret, uctrs, rapor, yillik, resmi)
For txt = 13 To 20
des = des + 1
Next txt
Kod:
Private Sub ListBox1_Click()
On Error Resume Next
TextBox1 = ListBox1.List(ListBox1.ListIndex, 0) 'ListBox'a tıkladığımızda değerleri textbox'lara alıyoruz.
ComboBox2 = ListBox1.List(ListBox1.ListIndex, 1)
TextBox3 = ListBox1.List(ListBox1.ListIndex, 2)
TextBox4 = ListBox1.List(ListBox1.ListIndex, 3)
TextBox5 = ListBox1.List(ListBox1.ListIndex, 4)
TextBox6 = ListBox1.List(ListBox1.ListIndex, 5)
TextBox7 = ListBox1.List(ListBox1.ListIndex, 6)
TextBox8 = ListBox1.List(ListBox1.ListIndex, 7)
TextBox9 = ListBox1.List(ListBox1.ListIndex, 8)
TextBox10 = ListBox1.List(ListBox1.ListIndex, 9)
ComboBox1 = ListBox1.List(ListBox1.ListIndex, 10)
TextBox12 = ListBox1.List(ListBox1.ListIndex, 11)
aranan = TextBox1.Value
Range("A:A").Find(aranan).Select
degistir_satır = ActiveCell.Row
End Sub
Kod:
Private Sub CommandButton10_Click()
TextBox13.Value = ""
TextBox14.Value = ""
TextBox15.Value = ""
TextBox16.Value = ""
TextBox17.Value = ""
TextBox18.Value = ""
TextBox19.Value = ""
TextBox20.Value = ""
Call UserForm_Initialize
End Sub
Kod:
On Error GoTo Bitir
'Site seçildiğinde yapılacak işlemler
Dim BUL As Range
Set BUL = Sheets("PERSONELDATA").Columns(2).Find(what:=ComboBox2)
ComboBox1.Text = BUL.Offset(0, 10).Value
Bitir:

