• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Listbox yerine Listview kullanma

  • Konbuyu başlatan Konbuyu başlatan seddur
  • Başlangıç tarihi Başlangıç tarihi
Katılım
12 Nisan 2012
Mesajlar
533
Excel Vers. ve Dili
Microsoft office professional plus 2019
Merhaba.Aşağıdaki kod ile Listbox3'e ve "Liste" sayfasına veri aktarıyorum.Yapmak istediğim Listbox3 yerine Listview1'e veri aktarılmasını sağlamak.Acaba kodları buna göre yeniden düzenleyebilir miyiz ? Şimdiden Teşekkür Ederim.

Private Sub CommandButton31_Click()
Dim s1 As Worksheet
Dim say, satir, xrow, topla As Variant
Dim bak, a, sut, i As Integer
Dim ListBox3 As OLEObject
If ListBox1.ListIndex = -1 Then Exit Sub
say = [a2]
For bak = 0 To Sheets("Anasayfa").ListBox3.ListCount - 1
If Sheets("Anasayfa").ListBox3.List(bak, 1) = ListBox1.List(ListBox1.ListIndex, 0) Then
say = Int(Sheets("Anasayfa").ListBox3.List(bak, 4)) + 1
satir = bak
xrow = Sheets("Liste").Cells(Rows.Count, "B").End(3).Row
xrow = (xrow - ListBox3.ListCount) + bak + 1
Exit For
End If
Next
If say = [a2] Then
ListBox3.AddItem
satir = ListBox3.ListCount - 1
End If
If ListBox1.ListIndex = -1 Then Exit Sub
For a = ListBox1.ListCount - 1 To 0 Step -1
If ListBox1.Selected(a) = True Then
ListBox3.List(satir, 1) = ListBox1.List(ListBox1.ListIndex, 0)
ListBox3.List(satir, 2) = ListBox1.List(ListBox1.ListIndex, 1)
ListBox3.List(satir, 3) = Sheets("Anasayfa").CommandButton1.Caption
ListBox3.List(satir, 4) = say
ListBox3.List(satir, 5) = say * ListBox1.List(ListBox1.ListIndex, 1)
ListBox3.List(satir, 0) = [a1]

xrow = IIf(xrow = 0, Sheets("Liste").Cells(Rows.Count, "B").End(3).Row + 1, xrow)
For sut = 1 To 7
Sheets("Liste").Cells(xrow, sut) = ListBox3.List(satir, sut - 1)
Next
End If:
Next:
end sub
 
Geri
Üst