Aşağıdaki kodda 'ÇİLEK' sayfasındaki "d" sütununda bulunan verilere mükerrer
kontrolü yapıp aynı olan kayıları listwieve getirmemesi için gereken düzenlemeyi nasıl yapabilirim.
Saygılar
Private Sub UserForm_Initialize()
Dim hwnd, i, K, A, N, L As Long
hwnd = FindWindowA(vbNullString, Me.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) Or &H20000
With bul
'.Height = Application.Height
'.Width = Application.Width
End With
For i = 3 To Sheets("DEĞER").Range("C80").End(3).Row
If Sheets("DEĞER").Cells(i, 3).Value <> Empty Then
ComboBox6.AddItem Sheets("DEĞER").Cells(i, 3).Value
ComboBox10.AddItem Sheets("DEĞER").Cells(i, 3).Value
End If
Next i
For K = 83 To Sheets("DEĞER").Range("D180").End(3).Row
If Sheets("DEĞER").Cells(K, 4).Value <> Empty Then
ComboBox7.AddItem Sheets("DEĞER").Cells(K, 4).Value
End If
Next K
For A = 201 To Sheets("DEĞER").Range("F3500").End(3).Row
If Sheets("DEĞER").Cells(A, 6).Value <> Empty Then
ComboBox8.AddItem Sheets("DEĞER").Cells(A, 6).Value
End If
Next A
For N = 2 To Sheets("ÇİLEK").Range("E10000").End(3).Row
If Sheets("ÇİLEK").Cells(N, 5).Value <> Empty Then
ComboBox3.AddItem Sheets("ÇİLEK").Cells(N, 5).Value
End If
Next N
For L = 83 To Sheets("DEĞER").Range("D180").End(3).Row
If Sheets("DEĞER").Cells(L, 4).Value <> Empty Then
ComboBox9.AddItem Sheets("DEĞER").Cells(L, 4).Value
End If
Next L
i = Empty
K = Empty
A = Empty
N = Empty
L = Empty
Set Sh = Sheets("VERİ")
son = Sh.Cells(65536, 1).End(xlUp).Row
yeni = True
With bul.ListView1
.ListItems.Clear
.Gridlines = True
.View = lvwReport
.FullRowSelect = True
With .ColumnHeaders
.Add , , Sh.Cells(1, 1), 40
.Add , , Sh.Cells(1, 2), 70
.Add , , Sh.Cells(1, 3), 96
.Add , , Sh.Cells(1, 4), 55
.Add , , Sh.Cells(1, 5), 180
.Add , , Sh.Cells(1, 6), 35
.Add , , Sh.Cells(1, 7), 30
.Add , , Sh.Cells(1, 8), 30
.Add , , Sh.Cells(1, 9), 30
.Add , , Sh.Cells(1, 10), 30
.Add , , Sh.Cells(1, 11), 30
.Add , , Sh.Cells(1, 12), 30
.Add , , Sh.Cells(1, 13), 30
.Add , , Sh.Cells(1, 14), 30
.Add , , Sh.Cells(1, 15), 40
.Add , , Sh.Cells(1, 16), 40
.Add , , Sh.Cells(1, 17), 40
.Add , , Sh.Cells(1, 18), 40
.Add , , Sh.Cells(1, 19), 40
.Add , , Sh.Cells(1, 20), 1
.Add , , Sh.Cells(1, 21), 100
.Add , , Sh.Cells(1, 22), 40
.Add , , Sh.Cells(1, 23), 40
.Add , , Sh.Cells(1, 24), 40
.Add , , Sh.Cells(1, 25), 40
.Add , , Sh.Cells(1, 26), 40
.Add , , Sh.Cells(1, 27), 40
.Add , , Sh.Cells(1, 28), 40
.Add , , Sh.Cells(1, 29), 50
.Add , , "Satir", 0
End With
End With
ListeGuncelle
Set Sh = Sheets("ÇİLEK")
son = Sh.Cells(65536, 1).End(xlUp).Row
yeni = True
With bul.ListView2
.ListItems.Clear
.Gridlines = True
.View = lvwReport
.FullRowSelect = True
With .ColumnHeaders
.Add , , Sh.Cells(1, 1), 40
.Add , , Sh.Cells(1, 2), 70
.Add , , Sh.Cells(1, 3), 96
.Add , , Sh.Cells(1, 4), 55
.Add , , Sh.Cells(1, 5), 180
.Add , , Sh.Cells(1, 6), 35
.Add , , Sh.Cells(1, 7), 30
.Add , , Sh.Cells(1, 8), 30
.Add , , Sh.Cells(1, 9), 30
.Add , , Sh.Cells(1, 10), 30
.Add , , Sh.Cells(1, 11), 30
.Add , , Sh.Cells(1, 12), 30
.Add , , Sh.Cells(1, 13), 30
.Add , , Sh.Cells(1, 14), 30
.Add , , Sh.Cells(1, 15), 40
.Add , , Sh.Cells(1, 16), 40
.Add , , Sh.Cells(1, 17), 40
.Add , , Sh.Cells(1, 18), 40
.Add , , Sh.Cells(1, 19), 40
.Add , , Sh.Cells(1, 20), 1
.Add , , Sh.Cells(1, 21), 40
.Add , , Sh.Cells(1, 22), 40
.Add , , Sh.Cells(1, 23), 40
.Add , , Sh.Cells(1, 24), 40
.Add , , Sh.Cells(1, 25), 40
.Add , , Sh.Cells(1, 26), 40
.Add , , "Satir", 0
End With
End With
ListeGuncelle1
End Sub
kontrolü yapıp aynı olan kayıları listwieve getirmemesi için gereken düzenlemeyi nasıl yapabilirim.
Saygılar
Private Sub UserForm_Initialize()
Dim hwnd, i, K, A, N, L As Long
hwnd = FindWindowA(vbNullString, Me.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) Or &H20000
With bul
'.Height = Application.Height
'.Width = Application.Width
End With
For i = 3 To Sheets("DEĞER").Range("C80").End(3).Row
If Sheets("DEĞER").Cells(i, 3).Value <> Empty Then
ComboBox6.AddItem Sheets("DEĞER").Cells(i, 3).Value
ComboBox10.AddItem Sheets("DEĞER").Cells(i, 3).Value
End If
Next i
For K = 83 To Sheets("DEĞER").Range("D180").End(3).Row
If Sheets("DEĞER").Cells(K, 4).Value <> Empty Then
ComboBox7.AddItem Sheets("DEĞER").Cells(K, 4).Value
End If
Next K
For A = 201 To Sheets("DEĞER").Range("F3500").End(3).Row
If Sheets("DEĞER").Cells(A, 6).Value <> Empty Then
ComboBox8.AddItem Sheets("DEĞER").Cells(A, 6).Value
End If
Next A
For N = 2 To Sheets("ÇİLEK").Range("E10000").End(3).Row
If Sheets("ÇİLEK").Cells(N, 5).Value <> Empty Then
ComboBox3.AddItem Sheets("ÇİLEK").Cells(N, 5).Value
End If
Next N
For L = 83 To Sheets("DEĞER").Range("D180").End(3).Row
If Sheets("DEĞER").Cells(L, 4).Value <> Empty Then
ComboBox9.AddItem Sheets("DEĞER").Cells(L, 4).Value
End If
Next L
i = Empty
K = Empty
A = Empty
N = Empty
L = Empty
Set Sh = Sheets("VERİ")
son = Sh.Cells(65536, 1).End(xlUp).Row
yeni = True
With bul.ListView1
.ListItems.Clear
.Gridlines = True
.View = lvwReport
.FullRowSelect = True
With .ColumnHeaders
.Add , , Sh.Cells(1, 1), 40
.Add , , Sh.Cells(1, 2), 70
.Add , , Sh.Cells(1, 3), 96
.Add , , Sh.Cells(1, 4), 55
.Add , , Sh.Cells(1, 5), 180
.Add , , Sh.Cells(1, 6), 35
.Add , , Sh.Cells(1, 7), 30
.Add , , Sh.Cells(1, 8), 30
.Add , , Sh.Cells(1, 9), 30
.Add , , Sh.Cells(1, 10), 30
.Add , , Sh.Cells(1, 11), 30
.Add , , Sh.Cells(1, 12), 30
.Add , , Sh.Cells(1, 13), 30
.Add , , Sh.Cells(1, 14), 30
.Add , , Sh.Cells(1, 15), 40
.Add , , Sh.Cells(1, 16), 40
.Add , , Sh.Cells(1, 17), 40
.Add , , Sh.Cells(1, 18), 40
.Add , , Sh.Cells(1, 19), 40
.Add , , Sh.Cells(1, 20), 1
.Add , , Sh.Cells(1, 21), 100
.Add , , Sh.Cells(1, 22), 40
.Add , , Sh.Cells(1, 23), 40
.Add , , Sh.Cells(1, 24), 40
.Add , , Sh.Cells(1, 25), 40
.Add , , Sh.Cells(1, 26), 40
.Add , , Sh.Cells(1, 27), 40
.Add , , Sh.Cells(1, 28), 40
.Add , , Sh.Cells(1, 29), 50
.Add , , "Satir", 0
End With
End With
ListeGuncelle
Set Sh = Sheets("ÇİLEK")
son = Sh.Cells(65536, 1).End(xlUp).Row
yeni = True
With bul.ListView2
.ListItems.Clear
.Gridlines = True
.View = lvwReport
.FullRowSelect = True
With .ColumnHeaders
.Add , , Sh.Cells(1, 1), 40
.Add , , Sh.Cells(1, 2), 70
.Add , , Sh.Cells(1, 3), 96
.Add , , Sh.Cells(1, 4), 55
.Add , , Sh.Cells(1, 5), 180
.Add , , Sh.Cells(1, 6), 35
.Add , , Sh.Cells(1, 7), 30
.Add , , Sh.Cells(1, 8), 30
.Add , , Sh.Cells(1, 9), 30
.Add , , Sh.Cells(1, 10), 30
.Add , , Sh.Cells(1, 11), 30
.Add , , Sh.Cells(1, 12), 30
.Add , , Sh.Cells(1, 13), 30
.Add , , Sh.Cells(1, 14), 30
.Add , , Sh.Cells(1, 15), 40
.Add , , Sh.Cells(1, 16), 40
.Add , , Sh.Cells(1, 17), 40
.Add , , Sh.Cells(1, 18), 40
.Add , , Sh.Cells(1, 19), 40
.Add , , Sh.Cells(1, 20), 1
.Add , , Sh.Cells(1, 21), 40
.Add , , Sh.Cells(1, 22), 40
.Add , , Sh.Cells(1, 23), 40
.Add , , Sh.Cells(1, 24), 40
.Add , , Sh.Cells(1, 25), 40
.Add , , Sh.Cells(1, 26), 40
.Add , , "Satir", 0
End With
End With
ListeGuncelle1
End Sub
