• DİKKAT

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

Listbox sayfa silme mesajı

Katılım
11 Şubat 2010
Mesajlar
202
Excel Vers. ve Dili
13 türkçe
Selamlar,
Listboxta evet hayır masjından sonra silinen sayfaların isimlerini uyarı olarak verebilir mi?
 

Ekli dosyalar

Kod:
Private Sub CommandButton1_Click()

  
cvp = MsgBox("Silmek İstiyorsanız Evet' e Basın, Sadece Gizlemek İstiyorsanız Hayır'a Basın", vbYesNo + vbQuestion)
If cvp = vbYes Then
 Application.DisplayAlerts = False
  Dim i As Integer
    For i = 0 To ListBox1.ListCount - 1
        
        If ListBox1.Selected(i) = True Then isim = ListBox1.List(i): Sheets(ListBox1.List(i)).Delete
    Next i
    UserForm_Initialize
    MsgBox " " & isim & " İsimli kişiye ait bilgiler silinmistir.", vbInformation, "ÇÖZGEN"


Else

End If
End Sub
 
Sadece bir isim çıkıyor. Silinen tüm sayfaları gösterebilir mi?
 
Userform5 deki kodu bununla değiştirin.

PHP:
Private Sub CommandButton1_Click()

cvp = MsgBox("Silmek İstiyorsanız Evet' e Basın, Sadece Gizlemek İstiyorsanız Hayır'a Basın", vbYesNo + vbQuestion)
If cvp = vbYes Then
Application.DisplayAlerts = False
Dim i As Integer
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
Sheets(ListBox1.List(i)).Delete
MsgBox ListBox1.List(i) & " Sayfa silindi.", vbInformation, "ÇÖZGEN"
End If
Next i
UserForm_Initialize
Else

End If
End Sub

veya bu kodu kullan

Kod:
Private Sub CommandButton1_Click()

Application.DisplayAlerts = False
Dim i As Integer
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then

cvp = MsgBox(ListBox1.List(i) & " Bu sayfayı Silmek İstiyormusunuz.", vbYesNo + vbQuestion)
If cvp = vbYes Then
Sheets(ListBox1.List(i)).Delete
MsgBox ListBox1.List(i) & " Sayfa silindi.", vbInformation, "ÇÖZGEN"
End If
End If
Next i

UserForm_Initialize

End Sub
 
Sayın @halit3 ,
Kodlarınız çalışıyor. Fakat tek bir mesajda gösterebilir miyiz? Resimdeki gibi.
Ekran Alıntısı.JPG
 
kod:
PHP:
Private Sub CommandButton1_Click()

cvp = MsgBox("Silmek İstiyorsanız Evet' e Basın, Sadece Gizlemek İstiyorsanız Hayır'a Basın", vbYesNo + vbQuestion)
If cvp = vbYes Then
Application.DisplayAlerts = False
Dim i As Integer, deg As String
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
Sheets(ListBox1.List(i)).Delete
deg = deg & ListBox1.List(i) & Chr(10)
End If
Next i


MsgBox "Şu sayfalar silindi" & Chr(10) & deg, vbInformation, "ÇÖZGEN"

UserForm_Initialize
Else

End If
End Sub
 
Geri
Üst