• DİKKAT

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

LİSTBOX'DAN VE SAYFADAN SİLMEK

  • Konbuyu başlatan Konbuyu başlatan cocoa35
  • Başlangıç tarihi Başlangıç tarihi
Katılım
6 Eylül 2007
Mesajlar
657
Excel Vers. ve Dili
excel 2016 32 Bit ve Excel 2020 32 Bit Türkçe ve İngilizce
Üstatlar merhaba ekli örnek dosyada açılan UserForm'da bulunan ListBox'da işaretlemiş olduğum satırı yine UserForm 'daki "Araç Sil " butonu ile silmek istiyorum, butona tıkladığımda hem listbox'dan hemde sayfadan silinmesini istiyorum bu konuda yardım lütfen
 

Ekli dosyalar

Merhabalar,
Araç sil butonuna (CommandButton5) alttaki kodları yazıp dene misiniz?

For i = 0 To Me.ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
Sayfa1.Range("A" & Me.ListBox1.ListIndex + 4 & ":S" & Me.ListBox1.ListIndex + 4).Delete Shift:=xlUp
Me.ListBox1.RowSource = "Araclar!A4:S" & Sayfa1.Range("A104000").End(xlUp).Row
End If
Next i
 
Son düzenleme:
Denemeden yazıyorum. byfikanın gösterdiği kodda şu satırı kodların en altına taşımanız daha mantıklı olacak.
CoffeeScript:
For i = 0 To Me.ListBox1.ListCount - 1
    If ListBox1.Selected(i) = True Then
        Sayfa1.Range("A" & Me.ListBox1.ListIndex + 4 & ":S" & Me.ListBox1.ListIndex + 4).Delete Shift:=xlUp
    End If
Next i
Me.ListBox1.RowSource = "Araclar!A4:S" & Sayfa1.Range("A104000").End(xlUp).Row
 
For i = 0 To Me.ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
Sayfa1.Range("A" & Me.ListBox1.ListIndex + 4 & ":S" & Me.ListBox1.ListIndex + 4).Delete Shift:=xlUp
Me.ListBox1.RowSource = "Araclar!A4:S" & Sayfa1.Range("A104000").End(xlUp).Row
End If
Next i
By Fika çok teşekkürler gayet güzel olmuş :)
 
Rica ederim. İyi çalışmalar
 
Geri
Üst