bilisim2010
Altın Üye
- Katılım
- 2 Nisan 2011
- Mesajlar
- 127
- Excel Vers. ve Dili
- office 2007 tr
- Altın Üyelik Bitiş Tarihi
- 17-12-2025
merhaba textboxda aratıp listboxda çift tıklayarak seçiyorum seçili satırı bir buton ile silmeye çalışınca en üst satırı seçip siliyor seçtiğim satırı silmesini nasıl sağlarım aşağıdaki kodlar arama yapmadan seçtiğim satırı siliyor olay arama yapıp seçtiğim satırda patlıyor. lütfen yardımcı olun
Private Sub TextBox1_Change()
Dim Son As Long, Veri As Variant, X As Long
Son = WorksheetFunction.Max(3, S1.Cells(S1.Rows.Count, 1).End(3).Row)
Veri = S1.Range("A2:Q" & Son).Value
lstpersonel.Clear
ReDim Liste(1 To 16, 1 To 1)
For X = LBound(Veri, 1) To UBound(Veri, 1)
If UCase(Replace(Replace(Veri(X, 2), "ı", "I"), "i", "İ")) Like "*" & _
UCase(Replace(Replace(TextBox1, "ı", "I"), "i", "İ")) & "*" Then
Say = Say + 1
ReDim Preserve Liste(1 To 16, 1 To Say)
For y = 1 To 16
Liste(y, Say) = Veri(X, y)
Next
End If
Next
If Say > 0 Then
With lstpersonel
.ColumnCount = 16
.Column = Liste
.AddItem , 0
For X = 1 To 16
.List(0, X - 1) = S1.Cells(1, X).Value
Next
.ListIndex = 0
End With
TextBox1.BackColor = &H80000005
TextBox1.ForeColor = &H80000008
Else
TextBox1.BackColor = vbRed
TextBox1.ForeColor = vbWhite
End If
Erase Veri
Erase Liste
End Sub
Private Sub UserForm_Initialize()
Set S1 = Sheets("KAYİT")
With Me.lstpersonel
.ColumnCount = 17
lstpersonel.ColumnWidths = "50;150;50;50;230;50;50;50;50;50;50;50;50;50;50;50"
.List = S1.Range("A2:Q" & S1.Cells(S1.Rows.Count, 1).End(3).Row).Value
.AddItem , 0
For X = 1 To 17
.List(0, X - 1) = S1.Cells(1, X).Value
Next
.ListIndex = 0
End With
End Sub
Dim ws As Worksheet
Dim comboSelection As String
Dim comboSelection1 As String
Dim comboSelection2 As String
Dim textbox7Value As String
Dim textbox6Value As String
Dim textbox1002Value As String
Dim textbox1003Value As String
Dim textbox1004Value As String
Dim textbox1005Value As String
Dim textbox1006Value As String
Dim textbox1007Value As String
Dim textbox1008Value As String
Dim textbox1009Value As String
Dim textbox1010Value As String
Dim textbox1011Value As String
Dim textbox1012Value As String
Dim textbox1013Value As String
Dim textbox1014Value As String
Dim textbox1018Value As String
Dim textbox1015Value As String
Dim textbox1016Value As String
Dim textbox1017Value As String
karar = MsgBox("Müşteri Kaydı Silinecek Onaylıyormusunuz?", vbYesNo, "Uyarı!")
If karar = vbYes Then
Set ws = ThisWorkbook.Sheets("KAYİT")
TextBox7.Value = ""
TextBox6.Value = ""
TextBox1002.Value = ""
TextBox1003.Value = ""
TextBox1004.Value = ""
TextBox1005.Value = ""
TextBox1006.Value = ""
TextBox1007.Value = ""
TextBox1008.Value = ""
TextBox1009.Value = ""
TextBox1010.Value = ""
TextBox1011.Value = ""
TextBox1012.Value = ""
TextBox1013.Value = ""
TextBox1014.Value = ""
TextBox1018.Value = ""
TextBox1015.Value = ""
TextBox1016.Value = ""
TextBox1017.Value = ""
ComboBox3.Value = ""
ComboBox4.Value = ""
ComboBox5.Value = ""
ComboBox6.Value = ""
ComboBox7.Value = ""
Selection.EntireRow.Delete
Else
MsgBox ("Silme İşlemi İptal Edildi.!"), vbInformation
End If
Private Sub TextBox1_Change()
Dim Son As Long, Veri As Variant, X As Long
Son = WorksheetFunction.Max(3, S1.Cells(S1.Rows.Count, 1).End(3).Row)
Veri = S1.Range("A2:Q" & Son).Value
lstpersonel.Clear
ReDim Liste(1 To 16, 1 To 1)
For X = LBound(Veri, 1) To UBound(Veri, 1)
If UCase(Replace(Replace(Veri(X, 2), "ı", "I"), "i", "İ")) Like "*" & _
UCase(Replace(Replace(TextBox1, "ı", "I"), "i", "İ")) & "*" Then
Say = Say + 1
ReDim Preserve Liste(1 To 16, 1 To Say)
For y = 1 To 16
Liste(y, Say) = Veri(X, y)
Next
End If
Next
If Say > 0 Then
With lstpersonel
.ColumnCount = 16
.Column = Liste
.AddItem , 0
For X = 1 To 16
.List(0, X - 1) = S1.Cells(1, X).Value
Next
.ListIndex = 0
End With
TextBox1.BackColor = &H80000005
TextBox1.ForeColor = &H80000008
Else
TextBox1.BackColor = vbRed
TextBox1.ForeColor = vbWhite
End If
Erase Veri
Erase Liste
End Sub
Private Sub UserForm_Initialize()
Set S1 = Sheets("KAYİT")
With Me.lstpersonel
.ColumnCount = 17
lstpersonel.ColumnWidths = "50;150;50;50;230;50;50;50;50;50;50;50;50;50;50;50"
.List = S1.Range("A2:Q" & S1.Cells(S1.Rows.Count, 1).End(3).Row).Value
.AddItem , 0
For X = 1 To 17
.List(0, X - 1) = S1.Cells(1, X).Value
Next
.ListIndex = 0
End With
End Sub
Dim ws As Worksheet
Dim comboSelection As String
Dim comboSelection1 As String
Dim comboSelection2 As String
Dim textbox7Value As String
Dim textbox6Value As String
Dim textbox1002Value As String
Dim textbox1003Value As String
Dim textbox1004Value As String
Dim textbox1005Value As String
Dim textbox1006Value As String
Dim textbox1007Value As String
Dim textbox1008Value As String
Dim textbox1009Value As String
Dim textbox1010Value As String
Dim textbox1011Value As String
Dim textbox1012Value As String
Dim textbox1013Value As String
Dim textbox1014Value As String
Dim textbox1018Value As String
Dim textbox1015Value As String
Dim textbox1016Value As String
Dim textbox1017Value As String
karar = MsgBox("Müşteri Kaydı Silinecek Onaylıyormusunuz?", vbYesNo, "Uyarı!")
If karar = vbYes Then
Set ws = ThisWorkbook.Sheets("KAYİT")
TextBox7.Value = ""
TextBox6.Value = ""
TextBox1002.Value = ""
TextBox1003.Value = ""
TextBox1004.Value = ""
TextBox1005.Value = ""
TextBox1006.Value = ""
TextBox1007.Value = ""
TextBox1008.Value = ""
TextBox1009.Value = ""
TextBox1010.Value = ""
TextBox1011.Value = ""
TextBox1012.Value = ""
TextBox1013.Value = ""
TextBox1014.Value = ""
TextBox1018.Value = ""
TextBox1015.Value = ""
TextBox1016.Value = ""
TextBox1017.Value = ""
ComboBox3.Value = ""
ComboBox4.Value = ""
ComboBox5.Value = ""
ComboBox6.Value = ""
ComboBox7.Value = ""
Selection.EntireRow.Delete
Else
MsgBox ("Silme İşlemi İptal Edildi.!"), vbInformation
End If