DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub CommandButton1_Click()
Dim i, x As Integer
'On Error Resume Next
Sayfa2.Select
sonsatir = WorksheetFunction.CountA(ActiveSheet.Range("A2:A61"))
With UserForm1.ListBox1
.Clear
.ColumnCount = 5
.ColumnWidths = "2;25;35;45;25"
.ColumnHeads = True
For i = 2 To sonsatir
If x = 1 Then GoTo atla
x = i - i
atla:
' .ListCount
y = ActiveSheet.Range("a2:a61").Cells(i, 1)
If ComboBox1.Value = y Then
.AddItem
.List(x, 1) = ActiveSheet.Range("A" & i + 1)
.List(x, 2) = ActiveSheet.Range("B" & i + 1)
.List(x, 3) = ActiveSheet.Range("C" & i + 1)
.List(x, 4) = ActiveSheet.Range("D" & i + 1)
x = 1
End If
Next
End With
End Sub
Private Sub ComboBox1_Change()
sonsatir = WorksheetFunction.CountA(ActiveSheet.Range("A:A"))
With UserForm1.ListBox1
.Clear
.ColumnCount = 5
.ColumnWidths = "2;25;35;45"
.ColumnHeads = True
On Error GoTo theend
For i = 1 To sonsatir
'If x = 1 Then GoTo atla
'x = .ListCount - .ListCount
atla:
x = .ListCount
y = ActiveSheet.Range("a2:a" & sonsatir).Cells(i, 1).Value
If ComboBox1.Text = y Then
.AddItem
.List(x, 1) = ActiveSheet.Range("A" & i + 1)
.List(x, 2) = ActiveSheet.Range("B" & i + 1)
.List(x, 3) = ActiveSheet.Range("C" & i + 1)
.List(x, 4) = ActiveSheet.Range("D" & i + 1)
'x = x + 1
End If
Next
End With
theend:
Exit Sub
End Sub