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

askm

Destek Ekibi
Destek Ekibi
Katılım
4 Haziran 2005
Mesajlar
2,745
Excel Vers. ve Dili
2010-2016
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
 
Katılım
11 Şubat 2010
Mesajlar
202
Excel Vers. ve Dili
13 türkçe
Sadece bir isim çıkıyor. Silinen tüm sayfaları gösterebilir mi?
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,758
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
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
 
Katılım
11 Şubat 2010
Mesajlar
202
Excel Vers. ve Dili
13 türkçe
Sayın @halit3 ,
Kodlarınız çalışıyor. Fakat tek bir mesajda gösterebilir miyiz? Resimdeki gibi.
Ekran Alıntısı.JPG
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,758
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
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
 
Üst